changeset 2421:74ec16ef847b trunk

[svn] - fix accidental removal of xmms_show_message
author nenolod
date Sat, 27 Jan 2007 04:32:08 -0800
parents b23f52fe132f
children b31111934cd3
files ChangeLog src/audacious/util.c
diffstat 2 files changed, 131 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Jan 27 04:07:46 2007 -0800
+++ b/ChangeLog	Sat Jan 27 04:32:08 2007 -0800
@@ -1,3 +1,21 @@
+2007-01-27 12:07:46 +0000  Michael Farber <01mf02@gmail.com>
+  revision [3850]
+  Removed util.* from libaudacious
+  Removed my C++ comments from ui_fileopener.c
+  Cleanups
+  
+  
+  trunk/src/audacious/genevent.c      |    7 -
+  trunk/src/audacious/input.c         |   11 +-
+  trunk/src/audacious/main.c          |    1 
+  trunk/src/audacious/playback.c      |   67 +++++++---------
+  trunk/src/audacious/ui_fileopener.c |    5 -
+  trunk/src/libaudacious/Makefile     |    1 
+  trunk/src/libaudacious/util.c       |  143 ------------------------------------
+  trunk/src/libaudacious/util.h       |    1 
+  8 files changed, 39 insertions(+), 197 deletions(-)
+
+
 2007-01-27 02:11:50 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
   revision [3848]
   - audacious.desktop is already installed, no need to do so here
--- a/src/audacious/util.c	Sat Jan 27 04:07:46 2007 -0800
+++ b/src/audacious/util.c	Sat Jan 27 04:32:08 2007 -0800
@@ -1031,3 +1031,116 @@
     return path;
 }
 
+/**
+ * xmms_show_message:
+ * @title: The title of the message to show.
+ * @text: The text of the message to show.
+ * @button_text: The text of the button which will close the messagebox.
+ * @modal: Whether or not the messagebox should be modal.
+ * @button_action: Code to execute on when the messagebox is closed, or %NULL.
+ * @action_data: Optional opaque data to pass to @button_action.
+ *
+ * Displays a message box.
+ *
+ * Return value: A GTK widget handle for the message box.
+ **/
+GtkWidget *
+xmms_show_message(const gchar * title, const gchar * text,
+                  const gchar * button_text, gboolean modal,
+                  GtkSignalFunc button_action, gpointer action_data)
+{
+  GtkWidget *dialog;
+  GtkWidget *dialog_vbox, *dialog_hbox, *dialog_bbox;
+  GtkWidget *dialog_bbox_b1;
+  GtkWidget *dialog_textlabel;
+  GtkWidget *dialog_icon;
+
+  dialog = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+  gtk_window_set_type_hint( GTK_WINDOW(dialog) , GDK_WINDOW_TYPE_HINT_DIALOG );
+  gtk_window_set_modal( GTK_WINDOW(dialog) , modal );
+  gtk_window_set_title( GTK_WINDOW(dialog) , title );
+  gtk_container_set_border_width( GTK_CONTAINER(dialog) , 10 );
+
+  dialog_vbox = gtk_vbox_new( FALSE , 0 );
+  dialog_hbox = gtk_hbox_new( FALSE , 0 );
+
+  /* icon */
+  dialog_icon = gtk_image_new_from_stock( GTK_STOCK_DIALOG_INFO , GTK_ICON_SIZE_DIALOG );
+  gtk_box_pack_start( GTK_BOX(dialog_hbox) , dialog_icon , FALSE , FALSE , 2 );
+
+  /* label */
+  dialog_textlabel = gtk_label_new( text );
+  /* gtk_label_set_selectable( GTK_LABEL(dialog_textlabel) , TRUE ); */
+  gtk_box_pack_start( GTK_BOX(dialog_hbox) , dialog_textlabel , TRUE , TRUE , 2 );
+
+  gtk_box_pack_start( GTK_BOX(dialog_vbox) , dialog_hbox , FALSE , FALSE , 2 );
+  gtk_box_pack_start( GTK_BOX(dialog_vbox) , gtk_hseparator_new() , FALSE , FALSE , 4 );
+
+  dialog_bbox = gtk_hbutton_box_new();
+  gtk_button_box_set_layout( GTK_BUTTON_BOX(dialog_bbox) , GTK_BUTTONBOX_END );
+  dialog_bbox_b1 = gtk_button_new_with_label( button_text );
+  g_signal_connect_swapped( G_OBJECT(dialog_bbox_b1) , "clicked" ,
+                            G_CALLBACK(gtk_widget_destroy) , dialog );
+  if ( button_action )
+    g_signal_connect( G_OBJECT(dialog_bbox_b1) , "clicked" ,
+                      button_action , action_data );
+  GTK_WIDGET_SET_FLAGS( dialog_bbox_b1 , GTK_CAN_DEFAULT);
+  gtk_widget_grab_default( dialog_bbox_b1 );
+
+  gtk_container_add( GTK_CONTAINER(dialog_bbox) , dialog_bbox_b1 );
+  gtk_box_pack_start( GTK_BOX(dialog_vbox) , dialog_bbox , FALSE , FALSE , 0 );
+
+  gtk_container_add( GTK_CONTAINER(dialog) , dialog_vbox );
+  gtk_widget_show_all(dialog);
+
+  return dialog;
+}
+
+
+/**
+ * audacious_get_localdir:
+ *
+ * Returns a string with the full path of Audacious local datadir (where config files are placed).
+ * It's useful in order to put in the right place custom config files for audacious plugins.
+ *
+ * Return value: a string with full path of Audacious local datadir (should be freed after use)
+ **/
+gchar*
+audacious_get_localdir(void)
+{
+  gchar *datadir;
+  gchar *tmp;
+
+  if ( (tmp = getenv("XDG_CONFIG_HOME")) == NULL )
+    datadir = g_build_filename( g_get_home_dir() , ".config" , "audacious" ,  NULL );
+  else
+    datadir = g_build_filename( tmp , "audacious" , NULL );
+
+  return datadir;
+}
+
+
+/**
+ * xmms_check_realtime_priority:
+ *
+ * Legacy function included for compatibility with XMMS.
+ *
+ * Return value: FALSE
+ **/
+gboolean
+xmms_check_realtime_priority(void)
+{
+    return FALSE;
+}
+
+/**
+ * xmms_usleep:
+ * @usec: The amount of microseconds to sleep.
+ *
+ * Legacy function included for compatibility with XMMS.
+ **/
+void
+xmms_usleep(gint usec)
+{
+    g_usleep(usec);
+}