Mercurial > audlegacy-plugins
annotate src/bluetooth/gui.c @ 2649:d891ba4be5a5
fixed crash when prefs window was closed while scanning
author | Paula Stanciu <paula.stanciu@gmail.com> |
---|---|
date | Sun, 25 May 2008 23:04:33 +0300 |
parents | 7fbff3287a56 |
children | 229647ca4942 |
rev | line source |
---|---|
2644 | 1 #include "gui.h" |
2 #include "bluetooth.h" | |
3 | |
4 static GtkWidget *window = NULL; | |
5 static GtkTreeModel *model; | |
6 GtkWidget *mainbox; | |
7 GtkWidget *hbox_top; | |
8 GtkWidget *hbox_bottom; | |
9 GtkWidget *box_about; | |
10 GtkWidget *box_about_left; | |
11 GtkWidget *box_about_right; | |
12 GtkWidget *headset_frame; | |
13 GtkWidget *about_frame; | |
14 GtkWidget *refresh; | |
15 GtkWidget *connect_button; | |
16 GtkWidget *close_button; | |
17 GtkWidget *treeview; | |
18 GtkWidget *label_p; | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
19 GtkWidget *label_c; |
2644 | 20 GtkWidget *label_a; |
21 GtkWidget *label_prod; | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
22 GtkWidget *label_class; |
2644 | 23 GtkWidget *label_address; |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
24 GList * dev = NULL; |
2644 | 25 enum{ |
26 COLUMN_PRODUCER, | |
27 NUM_COLUMNS | |
28 }; | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
29 static DeviceData test_data[]= |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
30 { |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
31 {0,"00:00:00:00:00","Scanning"} |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
32 }; |
2644 | 33 |
34 | |
35 static GtkTreeModel * create_model(void) | |
36 { | |
37 GtkListStore *store; | |
38 GtkTreeIter iter; | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
39 gint i=0; |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
40 /* create list store */ |
2644 | 41 store = gtk_list_store_new(NUM_COLUMNS, |
42 G_TYPE_STRING); | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
43 |
2644 | 44 /* add data to the list store */ |
45 for(i = 0;i<G_N_ELEMENTS(test_data);i++) | |
46 { | |
47 gtk_list_store_append(store,&iter); | |
48 gtk_list_store_set(store,&iter, | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
49 COLUMN_PRODUCER, test_data[i].name,-1); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
50 } |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
51 |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
52 return GTK_TREE_MODEL(store); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
53 } |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
54 static GtkTreeModel * rebuild_model(void) |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
55 { |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
56 |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
57 GtkListStore *store; |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
58 GtkTreeIter iter; |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
59 gint i=0; |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
60 gint dev_no=0; |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
61 GList *dev; |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
62 gchar *temp; |
2649
d891ba4be5a5
fixed crash when prefs window was closed while scanning
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2646
diff
changeset
|
63 if(!window) |
d891ba4be5a5
fixed crash when prefs window was closed while scanning
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2646
diff
changeset
|
64 return NULL; |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
65 /* create list store */ |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
66 store = gtk_list_store_new(NUM_COLUMNS, |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
67 G_TYPE_STRING); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
68 |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
69 /*add inf to test_data from audio_devices */ |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
70 dev_no = g_list_length(audio_devices); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
71 dev = audio_devices; |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
72 while(dev != NULL) |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
73 { |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
74 test_data[i].name = ((DeviceData*)(dev->data))-> name; |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
75 test_data[i].class = ((DeviceData*)(dev->data))-> class; |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
76 test_data[i].address = ((DeviceData*)(dev->data))-> address; |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
77 i++; |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
78 dev=g_list_next(dev); |
2644 | 79 } |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
80 if (dev_no == 0) |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
81 { |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
82 test_data[0].name = "No devices found!"; |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
83 test_data[0].class = 0; |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
84 test_data[0].address = "00:00:00:00:00"; |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
85 } |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
86 |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
87 /* add data to the list store */ |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
88 for(i = 0;i<G_N_ELEMENTS(test_data);i++) |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
89 { |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
90 gtk_list_store_append(store,&iter); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
91 gtk_list_store_set(store,&iter, |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
92 COLUMN_PRODUCER, test_data[i].name,-1); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
93 } |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
94 //set the labels |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
95 temp = g_strdup_printf("0x%x",test_data[0].class); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
96 gtk_label_set_text(GTK_LABEL(label_prod),test_data[0].name); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
97 gtk_label_set_text(GTK_LABEL(label_class),temp); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
98 gtk_label_set_text(GTK_LABEL(label_address),test_data[0].address); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
99 |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
100 return GTK_TREE_MODEL(store); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
101 |
2644 | 102 } |
103 | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
104 |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
105 void refresh_tree() |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
106 { |
2649
d891ba4be5a5
fixed crash when prefs window was closed while scanning
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2646
diff
changeset
|
107 if(!window) |
d891ba4be5a5
fixed crash when prefs window was closed while scanning
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2646
diff
changeset
|
108 return; |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
109 model = rebuild_model(); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
110 gtk_tree_view_set_model(GTK_TREE_VIEW(treeview),GTK_TREE_MODEL(model)); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
111 } |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
112 |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
113 |
2644 | 114 static void add_columns(GtkTreeView *treeview) |
115 { | |
116 GtkCellRenderer *renderer; | |
117 GtkTreeViewColumn *column; | |
118 // GtkTreeModel *model = gtk_tree_view_get_model (treeview); | |
119 | |
120 /* column for producer */ | |
121 renderer = gtk_cell_renderer_text_new (); | |
122 column = gtk_tree_view_column_new_with_attributes ("Producer", | |
123 renderer, | |
124 "text", | |
125 COLUMN_PRODUCER, | |
126 NULL); | |
127 gtk_tree_view_column_set_sort_column_id (column,COLUMN_PRODUCER); | |
128 gtk_tree_view_append_column (treeview, column); | |
129 | |
130 } | |
131 | |
132 void close_call(void){ | |
133 printf("close callback \n"); | |
134 gtk_widget_destroy (window); | |
135 window = NULL; | |
136 } | |
137 void select_row(GtkWidget *treeview){ | |
138 | |
139 GtkTreeIter iter; | |
140 gint sel; | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
141 gchar *temp; |
2644 | 142 printf("select\n"); |
143 GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(treeview)); | |
144 if(gtk_tree_selection_get_selected (selection, NULL,&iter)){ | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
145 GtkTreePath *path; |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
146 path = gtk_tree_model_get_path (model, &iter); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
147 sel = gtk_tree_path_get_indices (path)[0]; |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
148 printf("i=%d\n",sel); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
149 temp = g_strdup_printf("0x%x",test_data[sel].class); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
150 gtk_label_set_text(GTK_LABEL(label_prod),test_data[sel].name); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
151 gtk_label_set_text(GTK_LABEL(label_class),temp); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
152 gtk_label_set_text(GTK_LABEL(label_address),test_data[sel].address); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
153 gtk_tree_path_free (path); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
154 g_free(temp); |
2644 | 155 |
156 } | |
157 | |
158 | |
159 | |
160 } | |
161 void bt_cfg() | |
162 { | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
163 |
2644 | 164 if (!window) |
165 { | |
166 window = gtk_window_new (GTK_WINDOW_TOPLEVEL); | |
167 g_signal_connect (window, "destroy",G_CALLBACK (gtk_widget_destroyed), &window); | |
168 | |
169 mainbox = gtk_vbox_new(FALSE,4); | |
170 gtk_container_set_border_width (GTK_CONTAINER (mainbox), 4); | |
171 gtk_container_add (GTK_CONTAINER (window), mainbox); | |
172 | |
173 hbox_top = gtk_hbox_new(FALSE,4); | |
174 gtk_container_set_border_width (GTK_CONTAINER(hbox_top), 4); | |
175 gtk_container_add (GTK_CONTAINER (mainbox), hbox_top); | |
176 | |
177 hbox_bottom = gtk_hbox_new(FALSE,4); | |
178 gtk_container_set_border_width (GTK_CONTAINER (hbox_bottom), 4); | |
179 gtk_container_add (GTK_CONTAINER (mainbox), hbox_bottom); | |
180 | |
181 headset_frame = gtk_frame_new("Available Headsets"); | |
182 gtk_container_add (GTK_CONTAINER (hbox_top), headset_frame); | |
183 | |
184 about_frame = gtk_frame_new("Current Headset"); | |
185 gtk_container_add(GTK_CONTAINER(hbox_top),about_frame); | |
186 | |
187 refresh = gtk_button_new_with_mnemonic ("_Refresh"); | |
188 g_signal_connect (refresh, "clicked",G_CALLBACK (refresh_call), NULL); | |
189 gtk_container_add(GTK_CONTAINER(hbox_bottom),refresh); | |
190 | |
191 connect_button = gtk_button_new_with_mnemonic("_Connect"); | |
192 g_signal_connect(connect_button,"clicked",G_CALLBACK (connect_call), NULL); | |
193 gtk_container_add(GTK_CONTAINER(hbox_bottom),connect_button); | |
194 | |
195 close_button = gtk_button_new_with_mnemonic("_Close"); | |
196 g_signal_connect(close_button,"clicked",G_CALLBACK (close_call),NULL); | |
197 gtk_container_add(GTK_CONTAINER(hbox_bottom),close_button); | |
198 /* create tree model */ | |
199 model = create_model (); | |
200 | |
201 /* create tree view */ | |
202 treeview = gtk_tree_view_new_with_model (model); | |
203 gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview), TRUE); | |
204 gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)),GTK_SELECTION_SINGLE); | |
205 g_object_unref (model); | |
206 gtk_container_add (GTK_CONTAINER (headset_frame), treeview); | |
207 /* add columns to the tree view */ | |
208 add_columns (GTK_TREE_VIEW (treeview)); | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
209 |
2644 | 210 g_signal_connect(treeview,"cursor-changed",G_CALLBACK(select_row),treeview); |
211 | |
212 | |
213 box_about = gtk_hbox_new(FALSE,4); | |
214 gtk_container_set_border_width (GTK_CONTAINER (box_about), 4); | |
215 gtk_container_add (GTK_CONTAINER (about_frame), box_about); | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
216 |
2644 | 217 /*about box left - vbox */ |
218 | |
219 box_about_left = gtk_vbox_new(FALSE,4); | |
220 gtk_container_set_border_width (GTK_CONTAINER (box_about_left), 4); | |
221 gtk_container_add (GTK_CONTAINER (box_about), box_about_left); | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
222 |
2644 | 223 /*about box right - vbox */ |
224 box_about_right = gtk_vbox_new(TRUE,4); | |
225 gtk_container_set_border_width (GTK_CONTAINER (box_about_right), 4); | |
226 gtk_container_add (GTK_CONTAINER (box_about), box_about_right); | |
227 | |
228 /* Left labels */ | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
229 label_p = gtk_label_new("Name:"); |
2644 | 230 gtk_container_add(GTK_CONTAINER(box_about_left),label_p); |
231 | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
232 label_c = gtk_label_new("Class"); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
233 gtk_container_add(GTK_CONTAINER(box_about_left),label_c); |
2644 | 234 |
235 | |
236 label_a = gtk_label_new("Address:"); | |
237 gtk_container_add(GTK_CONTAINER(box_about_left),label_a); | |
238 | |
239 | |
240 /*right labels */ | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
241 label_prod = gtk_label_new("Scanning"); |
2644 | 242 gtk_container_add(GTK_CONTAINER(box_about_right),label_prod); |
243 | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
244 label_class = gtk_label_new(" "); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
245 gtk_container_add(GTK_CONTAINER(box_about_right),label_class); |
2644 | 246 |
247 | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
248 label_address = gtk_label_new(" "); |
2644 | 249 gtk_container_add(GTK_CONTAINER(box_about_right),label_address); |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
250 |
2644 | 251 gtk_window_set_default_size (GTK_WINDOW (window), 480, 180); |
252 if (!GTK_WIDGET_VISIBLE (window)) | |
253 gtk_widget_show_all (window); | |
254 else | |
255 { | |
256 gtk_widget_destroy (window); | |
257 window = NULL; | |
258 } | |
259 // return window; | |
260 } | |
261 // return window; | |
262 } | |
263 |