19 |
|
|
20 |
#include "appdata.h" |
#include "appdata.h" |
21 |
|
|
|
/* UI sizes */ |
|
|
/* TH: All this dialog size stuff should imho go into one central place */ |
|
|
|
|
|
#ifdef USE_HILDON |
|
|
// Making the dialog a little wider makes it less "crowded" |
|
|
static const guint LIST_OF_RELATIONS_DIALOG_WIDTH = 500; |
|
|
static const guint LIST_OF_RELATIONS_DIALOG_HEIGHT = 300; |
|
|
static const guint LIST_OF_MEMBERS_DIALOG_WIDTH = 500; |
|
|
static const guint LIST_OF_MEMBERS_DIALOG_HEIGHT = 300; |
|
|
#else |
|
|
// Desktop mode dialogs should be narrower and taller |
|
|
static const guint LIST_OF_RELATIONS_DIALOG_WIDTH = 475; |
|
|
static const guint LIST_OF_RELATIONS_DIALOG_HEIGHT = 350; |
|
|
static const guint LIST_OF_MEMBERS_DIALOG_WIDTH = 450; |
|
|
static const guint LIST_OF_MEMBERS_DIALOG_HEIGHT = 350; |
|
|
#endif |
|
|
|
|
|
|
|
22 |
/* --------------- relation dialog for an item (node or way) ----------- */ |
/* --------------- relation dialog for an item (node or way) ----------- */ |
23 |
|
|
24 |
typedef struct { |
typedef struct { |
74 |
} |
} |
75 |
|
|
76 |
/* ------------------ role dialog ---------------- */ |
/* ------------------ role dialog ---------------- */ |
77 |
GtkWidget *dialog = gtk_dialog_new_with_buttons(_("Select role"), |
GtkWidget *dialog = |
78 |
GTK_WINDOW(parent), GTK_DIALOG_MODAL, |
misc_dialog_new(MISC_DIALOG_NOSIZE,_("Select role"), |
79 |
GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, |
GTK_WINDOW(parent), |
80 |
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, |
GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, |
81 |
NULL); |
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, |
82 |
|
NULL); |
83 |
|
|
84 |
gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); |
gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); |
85 |
|
|
478 |
break; |
break; |
479 |
} |
} |
480 |
|
|
481 |
context->dialog = gtk_dialog_new_with_buttons(str, |
context->dialog = |
482 |
GTK_WINDOW(appdata->window), GTK_DIALOG_MODAL, |
misc_dialog_new(MISC_DIALOG_LARGE, str, |
483 |
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, |
GTK_WINDOW(appdata->window), |
484 |
NULL); |
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, |
485 |
|
NULL); |
486 |
g_free(str); |
g_free(str); |
487 |
|
|
488 |
gtk_dialog_set_default_response(GTK_DIALOG(context->dialog), |
gtk_dialog_set_default_response(GTK_DIALOG(context->dialog), |
489 |
GTK_RESPONSE_CLOSE); |
GTK_RESPONSE_CLOSE); |
490 |
|
|
|
gtk_window_set_default_size(GTK_WINDOW(context->dialog), |
|
|
LIST_OF_RELATIONS_DIALOG_WIDTH, |
|
|
LIST_OF_RELATIONS_DIALOG_HEIGHT); |
|
491 |
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(context->dialog)->vbox), |
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(context->dialog)->vbox), |
492 |
relation_item_list_widget(context), TRUE, TRUE, 0); |
relation_item_list_widget(context), TRUE, TRUE, 0); |
493 |
|
|
708 |
str = g_strdup_printf(_("Members of relation \"%s\""), str); |
str = g_strdup_printf(_("Members of relation \"%s\""), str); |
709 |
|
|
710 |
mcontext->dialog = |
mcontext->dialog = |
711 |
gtk_dialog_new_with_buttons(str, |
misc_dialog_new(MISC_DIALOG_MEDIUM, str, |
712 |
GTK_WINDOW(parent), GTK_DIALOG_MODAL, |
GTK_WINDOW(parent), |
713 |
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, |
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, |
714 |
NULL); |
NULL); |
715 |
g_free(str); |
g_free(str); |
716 |
|
|
717 |
gtk_dialog_set_default_response(GTK_DIALOG(mcontext->dialog), |
gtk_dialog_set_default_response(GTK_DIALOG(mcontext->dialog), |
718 |
GTK_RESPONSE_CLOSE); |
GTK_RESPONSE_CLOSE); |
719 |
|
|
|
gtk_window_set_default_size(GTK_WINDOW(mcontext->dialog), |
|
|
LIST_OF_MEMBERS_DIALOG_WIDTH, |
|
|
LIST_OF_MEMBERS_DIALOG_HEIGHT); |
|
|
|
|
720 |
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(mcontext->dialog)->vbox), |
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(mcontext->dialog)->vbox), |
721 |
member_list_widget(mcontext), TRUE, TRUE, 0); |
member_list_widget(mcontext), TRUE, TRUE, 0); |
722 |
|
|
909 |
printf("relation list\n"); |
printf("relation list\n"); |
910 |
|
|
911 |
context->dialog = |
context->dialog = |
912 |
gtk_dialog_new_with_buttons(_("All relations"), |
misc_dialog_new(MISC_DIALOG_LARGE, _("All relations"), |
913 |
GTK_WINDOW(appdata->window), GTK_DIALOG_MODAL, |
GTK_WINDOW(appdata->window), |
914 |
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, |
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, |
915 |
NULL); |
NULL); |
916 |
|
|
917 |
gtk_dialog_set_default_response(GTK_DIALOG(context->dialog), |
gtk_dialog_set_default_response(GTK_DIALOG(context->dialog), |
918 |
GTK_RESPONSE_CLOSE); |
GTK_RESPONSE_CLOSE); |
919 |
|
|
|
gtk_window_set_default_size(GTK_WINDOW(context->dialog), |
|
|
LIST_OF_RELATIONS_DIALOG_WIDTH, |
|
|
LIST_OF_RELATIONS_DIALOG_HEIGHT); |
|
|
|
|
920 |
context->show_btn = gtk_dialog_add_button(GTK_DIALOG(context->dialog), |
context->show_btn = gtk_dialog_add_button(GTK_DIALOG(context->dialog), |
921 |
_("Select"), GTK_RESPONSE_HELP); |
_("Select"), GTK_RESPONSE_HELP); |
922 |
|
|