Mercurial > pidgin
comparison pidgin/gtkrequest.c @ 22814:862382aa6086
Do not add a ':' if there's already one at the end. Thanks to wjt for
noticing.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Fri, 02 May 2008 16:55:59 +0000 |
parents | d6220093543b |
children | f10aba5592c6 5d681e194fb3 365b90fa23cf |
comparison
equal
deleted
inserted
replaced
22812:158dedbfd5f1 | 22814:862382aa6086 |
---|---|
1280 col_num++, fl = fl->next) | 1280 col_num++, fl = fl->next) |
1281 { | 1281 { |
1282 size_t col_offset = col_num * 2; | 1282 size_t col_offset = col_num * 2; |
1283 PurpleRequestFieldType type; | 1283 PurpleRequestFieldType type; |
1284 GtkWidget *widget = NULL; | 1284 GtkWidget *widget = NULL; |
1285 const char *field_label; | |
1285 | 1286 |
1286 label = NULL; | 1287 label = NULL; |
1287 field = fl->data; | 1288 field = fl->data; |
1288 | 1289 |
1289 if (!purple_request_field_is_visible(field)) { | 1290 if (!purple_request_field_is_visible(field)) { |
1290 col_num--; | 1291 col_num--; |
1291 continue; | 1292 continue; |
1292 } | 1293 } |
1293 | 1294 |
1294 type = purple_request_field_get_type(field); | 1295 type = purple_request_field_get_type(field); |
1295 | 1296 field_label = purple_request_field_get_label(field); |
1296 if (type != PURPLE_REQUEST_FIELD_BOOLEAN && | 1297 |
1297 purple_request_field_get_label(field)) | 1298 if (type != PURPLE_REQUEST_FIELD_BOOLEAN && field_label) |
1298 { | 1299 { |
1299 char *text; | 1300 char *text = NULL; |
1300 | 1301 |
1301 text = g_strdup_printf("%s:", | 1302 if (field_label[strlen(field_label) - 1] != ':') |
1302 purple_request_field_get_label(field)); | 1303 text = g_strdup_printf("%s:", field_label); |
1303 | 1304 |
1304 label = gtk_label_new(NULL); | 1305 label = gtk_label_new(NULL); |
1305 gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), text); | 1306 gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), text ? text : field_label); |
1306 g_free(text); | 1307 g_free(text); |
1307 | 1308 |
1308 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | 1309 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
1309 | 1310 |
1310 gtk_size_group_add_widget(sg, label); | 1311 gtk_size_group_add_widget(sg, label); |