Mercurial > audlegacy-plugins
annotate src/bluetooth/gui.c @ 2646:7fbff3287a56
added device discovery in the plugin's prefs window
| author | Paula Stanciu <paula.stanciu@gmail.com> |
|---|---|
| date | Sun, 25 May 2008 21:29:07 +0300 |
| parents | 6fd8ca4b7b17 |
| children | d891ba4be5a5 |
| 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; |
|
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
63 /* create list store */ |
|
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
64 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
|
65 G_TYPE_STRING); |
|
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
66 |
|
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
67 /*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
|
68 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
|
69 dev = audio_devices; |
|
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
70 while(dev != NULL) |
|
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
71 { |
|
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
72 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
|
73 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
|
74 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
|
75 i++; |
|
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
76 dev=g_list_next(dev); |
| 2644 | 77 } |
|
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
78 if (dev_no == 0) |
|
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
79 { |
|
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
80 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
|
81 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
|
82 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
|
83 } |
|
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
84 |
|
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
85 /* 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
|
86 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
|
87 { |
|
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
88 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
|
89 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
|
90 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
|
91 } |
|
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
92 //set the labels |
|
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
93 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
|
94 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
|
95 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
|
96 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
|
97 |
|
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
98 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
|
99 |
| 2644 | 100 } |
| 101 | |
|
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
102 |
|
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
103 void refresh_tree() |
|
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 model = rebuild_model(); |
|
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
106 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
|
107 } |
|
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
108 |
|
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
109 |
| 2644 | 110 static void add_columns(GtkTreeView *treeview) |
| 111 { | |
| 112 GtkCellRenderer *renderer; | |
| 113 GtkTreeViewColumn *column; | |
| 114 // GtkTreeModel *model = gtk_tree_view_get_model (treeview); | |
| 115 | |
| 116 /* column for producer */ | |
| 117 renderer = gtk_cell_renderer_text_new (); | |
| 118 column = gtk_tree_view_column_new_with_attributes ("Producer", | |
| 119 renderer, | |
| 120 "text", | |
| 121 COLUMN_PRODUCER, | |
| 122 NULL); | |
| 123 gtk_tree_view_column_set_sort_column_id (column,COLUMN_PRODUCER); | |
| 124 gtk_tree_view_append_column (treeview, column); | |
| 125 | |
| 126 } | |
| 127 | |
| 128 void close_call(void){ | |
| 129 printf("close callback \n"); | |
| 130 gtk_widget_destroy (window); | |
| 131 window = NULL; | |
| 132 } | |
| 133 void select_row(GtkWidget *treeview){ | |
| 134 | |
| 135 GtkTreeIter iter; | |
| 136 gint sel; | |
|
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
137 gchar *temp; |
| 2644 | 138 printf("select\n"); |
| 139 GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(treeview)); | |
| 140 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
|
141 GtkTreePath *path; |
|
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
142 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
|
143 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
|
144 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
|
145 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
|
146 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
|
147 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
|
148 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
|
149 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
|
150 g_free(temp); |
| 2644 | 151 |
| 152 } | |
| 153 | |
| 154 | |
| 155 | |
| 156 } | |
| 157 void bt_cfg() | |
| 158 { | |
|
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
159 |
| 2644 | 160 if (!window) |
| 161 { | |
| 162 window = gtk_window_new (GTK_WINDOW_TOPLEVEL); | |
| 163 g_signal_connect (window, "destroy",G_CALLBACK (gtk_widget_destroyed), &window); | |
| 164 | |
| 165 mainbox = gtk_vbox_new(FALSE,4); | |
| 166 gtk_container_set_border_width (GTK_CONTAINER (mainbox), 4); | |
| 167 gtk_container_add (GTK_CONTAINER (window), mainbox); | |
| 168 | |
| 169 hbox_top = gtk_hbox_new(FALSE,4); | |
| 170 gtk_container_set_border_width (GTK_CONTAINER(hbox_top), 4); | |
| 171 gtk_container_add (GTK_CONTAINER (mainbox), hbox_top); | |
| 172 | |
| 173 hbox_bottom = gtk_hbox_new(FALSE,4); | |
| 174 gtk_container_set_border_width (GTK_CONTAINER (hbox_bottom), 4); | |
| 175 gtk_container_add (GTK_CONTAINER (mainbox), hbox_bottom); | |
| 176 | |
| 177 headset_frame = gtk_frame_new("Available Headsets"); | |
| 178 gtk_container_add (GTK_CONTAINER (hbox_top), headset_frame); | |
| 179 | |
| 180 about_frame = gtk_frame_new("Current Headset"); | |
| 181 gtk_container_add(GTK_CONTAINER(hbox_top),about_frame); | |
| 182 | |
| 183 refresh = gtk_button_new_with_mnemonic ("_Refresh"); | |
| 184 g_signal_connect (refresh, "clicked",G_CALLBACK (refresh_call), NULL); | |
| 185 gtk_container_add(GTK_CONTAINER(hbox_bottom),refresh); | |
| 186 | |
| 187 connect_button = gtk_button_new_with_mnemonic("_Connect"); | |
| 188 g_signal_connect(connect_button,"clicked",G_CALLBACK (connect_call), NULL); | |
| 189 gtk_container_add(GTK_CONTAINER(hbox_bottom),connect_button); | |
| 190 | |
| 191 close_button = gtk_button_new_with_mnemonic("_Close"); | |
| 192 g_signal_connect(close_button,"clicked",G_CALLBACK (close_call),NULL); | |
| 193 gtk_container_add(GTK_CONTAINER(hbox_bottom),close_button); | |
| 194 /* create tree model */ | |
| 195 model = create_model (); | |
| 196 | |
| 197 /* create tree view */ | |
| 198 treeview = gtk_tree_view_new_with_model (model); | |
| 199 gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview), TRUE); | |
| 200 gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)),GTK_SELECTION_SINGLE); | |
| 201 g_object_unref (model); | |
| 202 gtk_container_add (GTK_CONTAINER (headset_frame), treeview); | |
| 203 /* add columns to the tree view */ | |
| 204 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
|
205 |
| 2644 | 206 g_signal_connect(treeview,"cursor-changed",G_CALLBACK(select_row),treeview); |
| 207 | |
| 208 | |
| 209 box_about = gtk_hbox_new(FALSE,4); | |
| 210 gtk_container_set_border_width (GTK_CONTAINER (box_about), 4); | |
| 211 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
|
212 |
| 2644 | 213 /*about box left - vbox */ |
| 214 | |
| 215 box_about_left = gtk_vbox_new(FALSE,4); | |
| 216 gtk_container_set_border_width (GTK_CONTAINER (box_about_left), 4); | |
| 217 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
|
218 |
| 2644 | 219 /*about box right - vbox */ |
| 220 box_about_right = gtk_vbox_new(TRUE,4); | |
| 221 gtk_container_set_border_width (GTK_CONTAINER (box_about_right), 4); | |
| 222 gtk_container_add (GTK_CONTAINER (box_about), box_about_right); | |
| 223 | |
| 224 /* Left labels */ | |
|
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
225 label_p = gtk_label_new("Name:"); |
| 2644 | 226 gtk_container_add(GTK_CONTAINER(box_about_left),label_p); |
| 227 | |
|
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
228 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
|
229 gtk_container_add(GTK_CONTAINER(box_about_left),label_c); |
| 2644 | 230 |
| 231 | |
| 232 label_a = gtk_label_new("Address:"); | |
| 233 gtk_container_add(GTK_CONTAINER(box_about_left),label_a); | |
| 234 | |
| 235 | |
| 236 /*right labels */ | |
|
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
237 label_prod = gtk_label_new("Scanning"); |
| 2644 | 238 gtk_container_add(GTK_CONTAINER(box_about_right),label_prod); |
| 239 | |
|
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
240 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
|
241 gtk_container_add(GTK_CONTAINER(box_about_right),label_class); |
| 2644 | 242 |
| 243 | |
|
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
244 label_address = gtk_label_new(" "); |
| 2644 | 245 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
|
246 |
| 2644 | 247 gtk_window_set_default_size (GTK_WINDOW (window), 480, 180); |
| 248 if (!GTK_WIDGET_VISIBLE (window)) | |
| 249 gtk_widget_show_all (window); | |
| 250 else | |
| 251 { | |
| 252 gtk_widget_destroy (window); | |
| 253 window = NULL; | |
| 254 } | |
| 255 // return window; | |
| 256 } | |
| 257 // return window; | |
| 258 } | |
| 259 |
