//DEFAULT_DEBUG_CHANNEL(tizen);
MULTI_DEBUG_CHANNEL(tizen, dialog);
+void show_message(const char *szTitle, const char *szMessage)
+{
+ GtkWidget *label;
+ GtkWidget *button;
+ GtkWidget *dialog_window;
+ /* create Dialog */
+
+ dialog_window = gtk_dialog_new();
+
+ /* Widget Icon set */
+
+ GdkPixbuf* tmppixbuf = NULL;
+ tmppixbuf=gtk_widget_render_icon((GtkWidget *) (dialog_window), GTK_STOCK_PROPERTIES, GTK_ICON_SIZE_MENU, NULL);
+ gtk_window_set_icon(GTK_WINDOW (dialog_window), tmppixbuf);
+
+ /* set Title and Border */
+
+ gtk_window_set_title(GTK_WINDOW(dialog_window), szTitle);
+ gtk_container_set_border_width(GTK_CONTAINER(dialog_window), 0);
+
+ /* set dialog not resizble */
+
+ gtk_window_set_resizable(GTK_WINDOW(dialog_window), FALSE);
+
+ /* create OK Button and Set Reponse */
+
+ button = gtk_dialog_add_button(GTK_DIALOG(dialog_window), GTK_STOCK_OK, GTK_RESPONSE_OK);
+
+ /* set OK Button to Default Button */
+#if GTK_CHECK_VERSION(2,20,0)
+ gtk_widget_set_can_default(button, TRUE);
+#else
+ GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
+#endif
+ gtk_widget_grab_default(button);
+
+ /* create Label */
+
+ label = gtk_label_new(szMessage);
+
+ /* set Padding arround Label */
+
+ gtk_misc_set_padding(GTK_MISC(label), 10, 10);
+
+ /* pack Label to Dialog */
+
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_window)->vbox), label, TRUE, TRUE, 0);
+
+ gtk_widget_show_all(dialog_window);
+
+ gtk_dialog_run(GTK_DIALOG(dialog_window));
+
+ gtk_widget_destroy(dialog_window);
+}
/**
- * @brief show message dialog
+ * @brief show sized dialog
* @param dialog title
* @param dialog message
* @date Nov 21. 2008
* */
-void show_message(const char *szTitle, const char *szMessage)
+void show_sized_message(const char *szTitle, const char *szMessage, const int maxlength)
{
GtkWidget *label;
GtkWidget *button;
GtkWidget *dialog_window;
-
/* create Dialog */
dialog_window = gtk_dialog_new();
/* set dialog not resizble */
- gtk_window_set_resizable(GTK_WINDOW(dialog_window), FALSE);
+ gtk_window_set_resizable(GTK_WINDOW(dialog_window), TRUE);
/* create OK Button and Set Reponse */
label = gtk_label_new(szMessage);
+ /* set line wrap mode */
+
+// gtk_label_set_width_chars(GTK_LABEL(label), 30);
+ gtk_label_set_max_width_chars(GTK_LABEL(label), maxlength);
+ gtk_label_set_line_wrap(GTK_LABEL(label),TRUE);
+ gtk_label_set_line_wrap_mode(GTK_LABEL(label), PANGO_WRAP_CHAR);
+ gtk_label_set_ellipsize(GTK_LABEL(label),PANGO_ELLIPSIZE_MIDDLE);
+ gtk_widget_set_tooltip_text(GTK_LABEL(label),szMessage);
/* set Padding arround Label */
gtk_misc_set_padding(GTK_MISC(label), 10, 10);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_window)->vbox), label, TRUE, TRUE, 0);
+
gtk_widget_show_all(dialog_window);
gtk_dialog_run(GTK_DIALOG(dialog_window));
, target_name, arch, resolution, ram_size_detail
, dpi, sdcard_detail, sdcard_path_detail, disk_path, basedisk_path);
- show_message("Virtual Target Details", details);
+ show_sized_message("Virtual Target Details", details, DIALOG_MAX_WIDTH);
#else /* _WIN32 */
gchar *details_win = NULL;
details_win = change_path_from_slash(details);
- show_message("Virtual Target Details", details_win);
+ show_sized_message("Virtual Target Details", details_win, DIALOG_MAX_WIDTH);
free(details_win);
#endif
, target_name, arch, resolution, ram_size_detail
, dpi, sdcard_detail, sdcard_path_detail, disk_path, basedisk_path);
- show_message("Virtual Target Details", details);
+ show_sized_message("Virtual Target Details", details, DIALOG_MAX_WIDTH);
#else /* _WIN32 */
/* todo: check image & base image */
details_win = change_path_from_slash(details);
- show_message("Virtual Target Details", details_win);
+ show_sized_message("Virtual Target Details", details_win, DIALOG_MAX_WIDTH);
free(details_win);
#endif