[svn r209] Removed gmyth_settings, put gmyth_backend* functions. trunk
authorrosfran
Wed Dec 06 20:22:48 2006 +0000 (2006-12-06)
branchtrunk
changeset 208c3c073032757
parent 207 6b697111497b
child 209 b8a07bf0375b
[svn r209] Removed gmyth_settings, put gmyth_backend* functions.
maemo-ui/src/mmyth_epg_grid_widget.c
maemo-ui/src/mmyth_epg_grid_widget.h
maemo-ui/src/mmyth_main.c
maemo-ui/src/mmyth_recordui.c
maemo-ui/src/mmyth_schedulerui.c
maemo-ui/src/mmyth_tvplayer.c
maemo-ui/src/mmyth_tvplayer.h
maemo-ui/src/mmyth_ui.c
maemo-ui/src/mmyth_ui.h
maemo-ui/src/mmyth_uisettings.c
     1.1 --- a/maemo-ui/src/mmyth_epg_grid_widget.c	Wed Dec 06 17:59:09 2006 +0000
     1.2 +++ b/maemo-ui/src/mmyth_epg_grid_widget.c	Wed Dec 06 20:22:48 2006 +0000
     1.3 @@ -37,6 +37,8 @@
     1.4      GList * channel_list;
     1.5      
     1.6      GMythEPG *mmyth_epg;
     1.7 +
     1.8 +    GMythBackendInfo *backend_info;
     1.9      
    1.10      gint DISPLAY_CHANS;
    1.11  };
    1.12 @@ -103,10 +105,13 @@
    1.13      private->current_end_time = time(&cur_time) + 10800;   
    1.14      
    1.15      private->DISPLAY_CHANS = MAX_DISPLAY_CHANS;
    1.16 -    
    1.17 +
    1.18 +    private->backend_info = gmyth_backend_info_new_full ( "192.168.1.109", "mythtv",
    1.19 +    	"mythtv", "mythconverg", 6543 );
    1.20 +
    1.21      // TODO: Close the epg and unref it in dispose call
    1.22      private->mmyth_epg = gmyth_epg_new ();
    1.23 -    if (!gmyth_epg_connect (private->mmyth_epg)) {
    1.24 +    if (!gmyth_epg_connect (private->mmyth_epg, private->backend_info)) {
    1.25      	g_warning ("[%s] Could not connect mysql handler to db", __FUNCTION__);
    1.26      	g_object_unref (private->mmyth_epg);
    1.27      	private->mmyth_epg = NULL;
     2.1 --- a/maemo-ui/src/mmyth_epg_grid_widget.h	Wed Dec 06 17:59:09 2006 +0000
     2.2 +++ b/maemo-ui/src/mmyth_epg_grid_widget.h	Wed Dec 06 20:22:48 2006 +0000
     2.3 @@ -6,8 +6,8 @@
     2.4  #include <gtk/gtkvbox.h>
     2.5  #include <gtk/gtkeventbox.h>
     2.6  
     2.7 -#include "gmyth_common.h"
     2.8 -
     2.9 +#include <gmyth/gmyth_common.h>
    2.10 +#include <gmyth/gmyth_backendinfo.h>
    2.11  #define MAX_DISPLAY_CHANS 4
    2.12  
    2.13  G_BEGIN_DECLS
    2.14 @@ -45,6 +45,7 @@
    2.15  
    2.16      /* Selected Schedule Item*/
    2.17      GList *selected_grid_item;  
    2.18 +
    2.19  };
    2.20  
    2.21  
     3.1 --- a/maemo-ui/src/mmyth_main.c	Wed Dec 06 17:59:09 2006 +0000
     3.2 +++ b/maemo-ui/src/mmyth_main.c	Wed Dec 06 20:22:48 2006 +0000
     3.3 @@ -8,11 +8,11 @@
     3.4  #include "hildon-widgets/hildon-window.h"
     3.5  #endif
     3.6  
     3.7 -#include "gmyth_recorder.h"
     3.8 -#include "gmyth_settings.h"
     3.9 -#include "gmyth_context.h"
    3.10 -#include "gmyth_tvchain.h"
    3.11 -#include "gmyth_remote_util.h"
    3.12 +#include <gmyth/gmyth_recorder.h>
    3.13 +#include <gmyth/gmyth_settings.h>
    3.14 +#include <gmyth/gmyth_context.h>
    3.15 +#include <gmyth/gmyth_tvchain.h>
    3.16 +#include <gmyth/gmyth_remote_util.h>
    3.17  
    3.18  #include "mmyth_ui.h"
    3.19  #include "mmyth_tvplayer.h"
    3.20 @@ -63,8 +63,7 @@
    3.21  #endif
    3.22  
    3.23      /* Init libmmyth context */
    3.24 -    gmyth_context_initialize ();
    3.25 -	
    3.26 +	/* TODO */
    3.27  #ifndef MAEMO_PLATFORM
    3.28      /* create the main window */
    3.29      window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
     4.1 --- a/maemo-ui/src/mmyth_recordui.c	Wed Dec 06 17:59:09 2006 +0000
     4.2 +++ b/maemo-ui/src/mmyth_recordui.c	Wed Dec 06 20:22:48 2006 +0000
     4.3 @@ -262,7 +262,7 @@
     4.4    	recordui->scheduler = gmyth_scheduler_new ();
     4.5      
     4.6      /* init connection to the backend */
     4.7 -    gmyth_scheduler_connect (recordui->scheduler);
     4.8 +    gmyth_scheduler_connect (recordui->scheduler, recordui->scheduler->backend_info);
     4.9      
    4.10  	return recordui;
    4.11  }
     5.1 --- a/maemo-ui/src/mmyth_schedulerui.c	Wed Dec 06 17:59:09 2006 +0000
     5.2 +++ b/maemo-ui/src/mmyth_schedulerui.c	Wed Dec 06 20:22:48 2006 +0000
     5.3 @@ -191,7 +191,7 @@
     5.4      /* FIXME: Architecture change to reuse the scheduler created in the recordui! */
     5.5      scheduler = gmyth_scheduler_new ();
     5.6  
     5.7 -    gmyth_scheduler_connect(scheduler);
     5.8 +    gmyth_scheduler_connect(scheduler, scheduler->backend_info);
     5.9  
    5.10      /* FIXME: set record_id = -1 to add a new schedule */
    5.11      schedule_info->record_id = -1;
    5.12 @@ -235,7 +235,7 @@
    5.13  	gtk_box_pack_start (GTK_BOX (hbox), combobox, FALSE, FALSE, 0);
    5.14  			
    5.15  	GMythEPG *mmyth_epg = gmyth_epg_new ();
    5.16 -	if (!gmyth_epg_connect (mmyth_epg)) {
    5.17 +	if (!gmyth_epg_connect (mmyth_epg, mmyth_epg->sqlquery->backend_info)) {
    5.18  		// FIXME: Without this list the scheduler UI should not be shown!
    5.19  		g_warning ("[%s] Error when getting list of channels", __FUNCTION__);
    5.20  	}
     6.1 --- a/maemo-ui/src/mmyth_tvplayer.c	Wed Dec 06 17:59:09 2006 +0000
     6.2 +++ b/maemo-ui/src/mmyth_tvplayer.c	Wed Dec 06 20:22:48 2006 +0000
     6.3 @@ -30,8 +30,9 @@
     6.4   
     6.5  #include <gdk/gdkx.h>
     6.6  
     6.7 -#include "gmyth_context.h"
     6.8 -#include "gmyth_remote_util.h"
     6.9 +#include <gmyth/gmyth_remote_util.h>
    6.10 +
    6.11 +#define MYTHTV_VERSION_DEFAULT	30
    6.12  
    6.13  typedef struct _GstPlayerWindowStateChange
    6.14  {
    6.15 @@ -73,10 +74,10 @@
    6.16  {
    6.17  	GObjectClass *gobject_class;
    6.18  
    6.19 -    gobject_class = (GObjectClass *) klass;
    6.20 -	
    6.21 -    gobject_class->dispose  = mmyth_tvplayer_dispose;
    6.22 -    gobject_class->finalize = mmyth_tvplayer_finalize;	
    6.23 +	gobject_class = (GObjectClass *) klass;
    6.24 +
    6.25 +	gobject_class->dispose  = mmyth_tvplayer_dispose;
    6.26 +	gobject_class->finalize = mmyth_tvplayer_finalize;	
    6.27  }
    6.28  
    6.29  static void
    6.30 @@ -214,15 +215,16 @@
    6.31   * successfully, FALSE otherwise.
    6.32   */
    6.33  gboolean
    6.34 -mmyth_tvplayer_initialize (MMythTVPlayer *tvplayer)
    6.35 +mmyth_tvplayer_initialize (MMythTVPlayer *tvplayer, GMythBackendInfo *backend_info)
    6.36  {
    6.37 -	
    6.38 -    if (!mmyth_tvplayer_create_pipeline (tvplayer)) {
    6.39 -    	g_warning ("[%s] Error while creating pipeline. TV Player not initialized", __FUNCTION__);
    6.40 +	tvplayer->backend_info = backend_info;
    6.41 +
    6.42 +	if (!mmyth_tvplayer_create_pipeline (tvplayer)) {
    6.43 +		g_warning ("[%s] Error while creating pipeline. TV Player not initialized", __FUNCTION__);
    6.44  		return FALSE;
    6.45  	} else {
    6.46  		g_debug ("[%s] GStreamer pipeline created", __FUNCTION__);	
    6.47 -    }
    6.48 +	}
    6.49  
    6.50  	return TRUE;
    6.51  }
    6.52 @@ -317,7 +319,7 @@
    6.53      g_object_ref (tvplayer->audioqueue1);
    6.54      g_object_ref (tvplayer->audioqueue2);
    6.55    	
    6.56 -    g_object_set (G_OBJECT (videosink), "sync", TRUE, NULL);
    6.57 +    //g_object_set (G_OBJECT (videosink), "sync", TRUE, NULL);
    6.58      g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
    6.59  
    6.60      gst_bus_add_watch (gst_pipeline_get_bus (GST_PIPELINE (tvplayer->gst_pipeline)),
    6.61 @@ -353,14 +355,12 @@
    6.62  gboolean
    6.63  mmyth_tvplayer_record_setup (MMythTVPlayer *tvplayer, gchar *filename)
    6.64  {
    6.65 -	GMythSettings *msettings = gmyth_context_get_settings();
    6.66 -	
    6.67  	// FIXME: we should receive the uri instead of filename
    6.68 -	GString *hostname = gmyth_settings_get_backend_hostname (msettings);
    6.69 -	int port = gmyth_settings_get_backend_port(msettings);
    6.70 +	gchar *hostname = gmyth_backend_info_get_hostname (tvplayer->backend_info);
    6.71 +	gint port = gmyth_backend_info_get_port(tvplayer->backend_info);
    6.72  	
    6.73  	GString *fullpath = g_string_new ("myth://");
    6.74 -	g_string_append_printf (fullpath, "%s:%d/%s", hostname->str, port, filename);
    6.75 +	g_string_append_printf (fullpath, "%s:%d/%s", hostname, port, filename);
    6.76  	
    6.77  	tvplayer->is_livetv = FALSE;
    6.78  
    6.79 @@ -381,90 +381,24 @@
    6.80  gboolean
    6.81  mmyth_tvplayer_livetv_setup (MMythTVPlayer *tvplayer)
    6.82  {
    6.83 -	GMythSettings *msettings = gmyth_context_get_settings ();
    6.84  	gboolean res = TRUE;
    6.85 +	gchar *hostname;
    6.86  
    6.87 -	res = gmyth_context_check_connection();
    6.88 -	if (!res) {
    6.89 -		g_warning ("[%s] LiveTV can not connect to backend", __FUNCTION__);	
    6.90 -		res = FALSE;
    6.91 +	tvplayer->livetv = gmyth_livetv_new ();
    6.92 +
    6.93 +	if ( !gmyth_livetv_setup( tvplayer->livetv, tvplayer->backend_info ) )
    6.94  		goto error;
    6.95 -	}
    6.96 -
    6.97 -	tvplayer->backend_hostname = gmyth_settings_get_backend_hostname(msettings);
    6.98 -	tvplayer->backend_port = gmyth_settings_get_backend_port (msettings);
    6.99 -
   6.100 -	tvplayer->local_hostname  = g_string_new("");    
   6.101 -	gmyth_context_get_local_hostname (tvplayer->local_hostname);
   6.102 -
   6.103 -	if ( tvplayer->local_hostname == NULL ) {
   6.104 -		res = FALSE;
   6.105 -		goto error;
   6.106 -	}
   6.107 -
   6.108 -	// Gets the remote encoder num
   6.109 -	tvplayer->recorder = remote_request_next_free_recorder (-1);
   6.110 -
   6.111 -	if ( tvplayer->recorder == NULL ) {
   6.112 -		g_warning ("[%s] None remote encoder available", __FUNCTION__);
   6.113 -		res = FALSE;
   6.114 -		goto error;
   6.115 -	}
   6.116 -
   6.117 -	// Creates livetv chain handler
   6.118 -	tvplayer->tvchain = GMYTH_TVCHAIN ( g_object_new(GMYTH_TVCHAIN_TYPE, NULL) );
   6.119 -	gmyth_tvchain_initialize ( tvplayer->tvchain, tvplayer->local_hostname );
   6.120 -
   6.121 -	if ( tvplayer->tvchain == NULL || tvplayer->tvchain->tvchain_id == NULL ) {
   6.122 -		res = FALSE;
   6.123 -		goto error;
   6.124 -	}
   6.125 -
   6.126 -	// Init remote encoder. Opens its control socket.
   6.127 -	res = gmyth_recorder_setup(tvplayer->recorder);
   6.128 -	if ( !res ) {
   6.129 -		g_warning ("[%s] Fail while setting remote encoder\n", __FUNCTION__);
   6.130 -		res = FALSE;
   6.131 -		goto error;
   6.132 -	}
   6.133 -	// Spawn live tv. Uses the socket to send mythprotocol data to start livetv in the backend (remotelly)
   6.134 -	res = gmyth_recorder_spawntv ( tvplayer->recorder,
   6.135 -			gmyth_tvchain_get_id(tvplayer->tvchain) );
   6.136 -	if (!res) {
   6.137 -		g_warning ("[%s] Fail while spawn tv\n", __FUNCTION__);
   6.138 -		res = FALSE;
   6.139 -		goto error;
   6.140 -	}
   6.141 -
   6.142 -	// Reload all TV chain from Mysql database.
   6.143 -	gmyth_tvchain_reload_all (tvplayer->tvchain);
   6.144 -
   6.145 -	if ( tvplayer->tvchain == NULL ) {
   6.146 -		res = FALSE;
   6.147 -		goto error;
   6.148 -	}
   6.149 -
   6.150 -	// Get program info from database using chanid and starttime
   6.151 -	tvplayer->proginfo = gmyth_tvchain_get_program_at (tvplayer->tvchain, -1);
   6.152 -	if ( tvplayer->proginfo == NULL ) {
   6.153 -		g_warning ("[%s] LiveTV not successfully started.\n", __FUNCTION__ );
   6.154 -		res = FALSE;
   6.155 -		goto error;
   6.156 -	} else {
   6.157 -		g_debug ("[%s] MythLiveTV: All requests to backend to start TV were OK.\n", __FUNCTION__ );
   6.158 -	}
   6.159 -
   6.160 +	
   6.161  	return res;
   6.162  
   6.163  error:
   6.164 -	if ( tvplayer->backend_hostname != NULL ) {
   6.165 -		g_string_free( tvplayer->backend_hostname, TRUE );
   6.166 -		res = FALSE;
   6.167 +	res = FALSE;
   6.168 +	if ( tvplayer->livetv != NULL ) {
   6.169 +		g_object_unref( tvplayer->livetv );
   6.170  	}
   6.171  
   6.172  	if ( tvplayer->local_hostname != NULL ) {
   6.173  		g_string_free( tvplayer->local_hostname, TRUE );
   6.174 -		res = FALSE;
   6.175  	}
   6.176  
   6.177  	if ( tvplayer->recorder != NULL ) {
     7.1 --- a/maemo-ui/src/mmyth_tvplayer.h	Wed Dec 06 17:59:09 2006 +0000
     7.2 +++ b/maemo-ui/src/mmyth_tvplayer.h	Wed Dec 06 20:22:48 2006 +0000
     7.3 @@ -36,9 +36,10 @@
     7.4  #include <gst/gst.h>
     7.5  #include <gst/interfaces/xoverlay.h>
     7.6  
     7.7 -#include "gmyth_recorder.h"
     7.8 -#include "gmyth_tvchain.h"
     7.9 -#include "gmyth_common.h"
    7.10 +#include <gmyth/gmyth_recorder.h>
    7.11 +#include <gmyth/gmyth_tvchain.h>
    7.12 +#include <gmyth/gmyth_common.h>
    7.13 +#include <gmyth/gmyth_livetv.h>
    7.14  
    7.15  G_BEGIN_DECLS
    7.16  
    7.17 @@ -88,6 +89,9 @@
    7.18  	GMythRecorder *recorder;
    7.19  	GMythTVChain *tvchain;
    7.20  	GMythProgramInfo *proginfo;
    7.21 +	GMythLiveTV *livetv;
    7.22 +
    7.23 +	GMythBackendInfo *backend_info;
    7.24  	
    7.25  	gboolean is_livetv;
    7.26  };
    7.27 @@ -96,7 +100,7 @@
    7.28  GType          mmyth_tvplayer_get_type (void);
    7.29  
    7.30  MMythTVPlayer* mmyth_tvplayer_new ();
    7.31 -gboolean       mmyth_tvplayer_initialize (MMythTVPlayer *tvplayer);
    7.32 +gboolean       mmyth_tvplayer_initialize (MMythTVPlayer *tvplayer, GMythBackendInfo *backend_info);
    7.33  
    7.34  void           mmyth_tvplayer_start_playing   (MMythTVPlayer *tvplayer);
    7.35  void           mmyth_tvplayer_stop_playing    (MMythTVPlayer *tvplayer);
     8.1 --- a/maemo-ui/src/mmyth_ui.c	Wed Dec 06 17:59:09 2006 +0000
     8.2 +++ b/maemo-ui/src/mmyth_ui.c	Wed Dec 06 20:22:48 2006 +0000
     8.3 @@ -19,7 +19,6 @@
     8.4  #include "mmyth_tvplayer.h"
     8.5  
     8.6  /* GMyth library includes */
     8.7 -#include "gmyth_context.h"
     8.8  
     8.9  #ifndef MAEMO_PLATFORM
    8.10  static gint button_press_handler (GtkWidget *widget, GdkEvent *event);
    8.11 @@ -57,6 +56,8 @@
    8.12  
    8.13      mmyth_ui = g_new0 (MMythUi, 1);
    8.14  
    8.15 +    mmyth_ui->backend_info = gmyth_backend_info_new_full( "192.168.1.109", "mythtv", "mythtv", "mythconverg", 6543 );
    8.16 +
    8.17      mmyth_ui->main_window = main_window;    
    8.18      mmyth_ui->videow = NULL;
    8.19      mmyth_ui->mmyth_recordui = NULL;
    8.20 @@ -215,7 +216,7 @@
    8.21      if (mmyth_uisettings_run (GTK_WINDOW (mmyth_ui->main_window))) {
    8.22      	// If user changes the settings, we restart the context
    8.23      	g_debug ("[%s] Restarting mmyth_context to new settings", __FUNCTION__);
    8.24 -    	gmyth_context_initialize();
    8.25 +    	//gmyth_context_initialize();
    8.26      }
    8.27  }
    8.28  
    8.29 @@ -313,7 +314,7 @@
    8.30  	/* choose here if this is a LiveTV session */
    8.31  	mmyth_ui->tvplayer->is_livetv = TRUE;
    8.32  
    8.33 -	res = mmyth_tvplayer_initialize (mmyth_ui->tvplayer);
    8.34 +	res = mmyth_tvplayer_initialize (mmyth_ui->tvplayer, mmyth_ui->backend_info);
    8.35  
    8.36  	if (!res) {
    8.37  		g_warning ("[%s] Could not initialize tvplayer", __FUNCTION__);
    8.38 @@ -596,7 +597,7 @@
    8.39  	// Creates the tv player that will retrieve the mythtv content, decode and show it
    8.40  	mmyth_ui->tvplayer = mmyth_tvplayer_new ();
    8.41  	g_debug ("[%s] New TV Player created: %d\n", __FUNCTION__, (int) (mmyth_ui->tvplayer));
    8.42 -	res = mmyth_tvplayer_initialize (mmyth_ui->tvplayer);
    8.43 +	res = mmyth_tvplayer_initialize (mmyth_ui->tvplayer, mmyth_ui->backend_info);
    8.44  	if (!res) {
    8.45  		g_warning ("[%s] Could not initialize tvplayer", __FUNCTION__);
    8.46  
     9.1 --- a/maemo-ui/src/mmyth_ui.h	Wed Dec 06 17:59:09 2006 +0000
     9.2 +++ b/maemo-ui/src/mmyth_ui.h	Wed Dec 06 20:22:48 2006 +0000
     9.3 @@ -16,6 +16,9 @@
     9.4  #include "mmyth_schedulerui.h"
     9.5  #include "mmyth_tvplayer.h"
     9.6  
     9.7 +/* GMyth specific includes */
     9.8 +#include <gmyth/gmyth_backendinfo.h>
     9.9 +
    9.10  typedef struct _MMythUi
    9.11  {
    9.12  
    9.13 @@ -34,6 +37,8 @@
    9.14      MMythUiCommon *epg_grid_uicommon;
    9.15      MMythUiCommon *record_uicommon;
    9.16      MMythUiCommon *schedule_uicommon;
    9.17 +
    9.18 +    GMythBackendInfo *backend_info;
    9.19      
    9.20      GtkWidget *videow;
    9.21      int idle_id;
    10.1 --- a/maemo-ui/src/mmyth_uisettings.c	Wed Dec 06 17:59:09 2006 +0000
    10.2 +++ b/maemo-ui/src/mmyth_uisettings.c	Wed Dec 06 20:22:48 2006 +0000
    10.3 @@ -9,7 +9,7 @@
    10.4  
    10.5  #include "mmyth_uisettings.h"
    10.6  
    10.7 -#include "gmyth_context.h"
    10.8 +#include <gmyth/gmyth_backendinfo.h>
    10.9  
   10.10  static GtkWidget *settings_dialog;
   10.11  static GtkWidget *entry_hostname;
   10.12 @@ -19,12 +19,13 @@
   10.13  static GtkWidget *entry_port;
   10.14  
   10.15  static void settings_dialog_update_data (void);
   10.16 -static GtkWidget* add_entry_to_table (GtkWidget *table, GString *init_str,
   10.17 +static GtkWidget* add_entry_to_table (GtkWidget *table, const gchar *init_str,
   10.18  	guint pos_left, guint pos_right, guint pos_top, guint pos_bottom);
   10.19  static GtkWidget* add_label_to_table (GtkWidget *table, const gchar *str, 
   10.20  	guint pos_left, guint pos_right,  guint pos_top, guint pos_bottom);
   10.21  	
   10.22 -	
   10.23 +static GMythBackendInfo *backend_info = NULL;
   10.24 +
   10.25  gboolean
   10.26  mmyth_uisettings_run (GtkWindow *main_window)
   10.27  {
   10.28 @@ -33,7 +34,8 @@
   10.29  	GtkWidget *label_hostname, *label_dbname;
   10.30  	GtkWidget *label_username, *label_passwd, *label_port;
   10.31  
   10.32 -	GMythSettings *msettings = gmyth_context_get_settings();
   10.33 +	backend_info = gmyth_backend_info_new_full( "192.168.1.109", "mythtv", 
   10.34 +			"mythtv", "mythconverg", 6543 );
   10.35  	
   10.36  	settings_dialog = gtk_dialog_new_with_buttons ("Settings",
   10.37                                           main_window,
   10.38 @@ -72,24 +74,20 @@
   10.39  	label_port = add_label_to_table (settings_table, "Server port:", 0, 1, 4, 5);
   10.40  	
   10.41  	entry_hostname = add_entry_to_table (settings_table,
   10.42 -		gmyth_settings_get_backend_hostname (msettings),
   10.43 +		gmyth_backend_info_get_hostname (backend_info),
   10.44  		1, 2, 0, 1);
   10.45  	entry_dbname = add_entry_to_table (settings_table,
   10.46 -		gmyth_settings_get_dbname (msettings),
   10.47 +		gmyth_backend_info_get_db_name (backend_info),
   10.48  		1, 2, 1, 2 );
   10.49  	entry_username = add_entry_to_table (settings_table,
   10.50 -		gmyth_settings_get_username (msettings),
   10.51 +		gmyth_backend_info_get_username (backend_info),
   10.52  		1, 2, 2, 3 );
   10.53  	entry_passwd = add_entry_to_table (settings_table,
   10.54 -		gmyth_settings_get_password (msettings),
   10.55 +		gmyth_backend_info_get_password (backend_info),
   10.56  		1, 2, 3, 4 );
   10.57  		
   10.58 -	GString *str_port = g_string_new ("");
   10.59 -	g_string_printf (str_port, "%d", 
   10.60 -		gmyth_settings_get_backend_port (msettings));
   10.61 -	entry_port = add_entry_to_table (settings_table, str_port,
   10.62 +	entry_port = add_entry_to_table (settings_table, g_strdup_printf( "%d", gmyth_backend_info_get_port (backend_info) ),
   10.63  		1, 2, 4, 5 );
   10.64 -	g_string_free (str_port, TRUE);
   10.65  		
   10.66  	if (gtk_dialog_run (GTK_DIALOG (settings_dialog)) == GTK_RESPONSE_ACCEPT) {
   10.67  		settings_dialog_update_data ();
   10.68 @@ -120,7 +118,7 @@
   10.69  }
   10.70  
   10.71  static GtkWidget*
   10.72 -add_entry_to_table (GtkWidget *table, GString *init_str, guint pos_left, guint pos_right,
   10.73 +add_entry_to_table (GtkWidget *table, const gchar *init_str, guint pos_left, guint pos_right,
   10.74  		guint pos_top, guint pos_bottom)
   10.75  {
   10.76  	GtkWidget *tmp_entry = gtk_entry_new ();
   10.77 @@ -130,7 +128,7 @@
   10.78                      (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
   10.79                      (GtkAttachOptions) (0), 0, 0);
   10.80      if (init_str)
   10.81 -		gtk_entry_set_text (GTK_ENTRY (tmp_entry), (init_str->str));
   10.82 +		gtk_entry_set_text (GTK_ENTRY (tmp_entry), init_str);
   10.83  		
   10.84  	//gtk_entry_set_invisible_char (GTK_ENTRY (entry_port), 9679);
   10.85  	
   10.86 @@ -141,29 +139,24 @@
   10.87  settings_dialog_update_data (void) 
   10.88  {
   10.89  	GString *tmp_entry_text;
   10.90 -	GMythSettings *msettings = gmyth_context_get_settings();
   10.91 +	//GMythSettings *backend_info = gmyth_context_get_settings();
   10.92  	
   10.93 -	if (!msettings) {
   10.94 +	if (!backend_info) {
   10.95  		g_warning ("[%s] Could not get GMythSettings instance from context\n", __FUNCTION__);
   10.96  		return;
   10.97  	}
   10.98  		
   10.99 -	tmp_entry_text = g_string_new("");
  10.100 -	g_string_printf(tmp_entry_text, "%s", gtk_entry_get_text( GTK_ENTRY(entry_hostname)));
  10.101 -	gmyth_settings_set_backend_hostname(msettings, tmp_entry_text);
  10.102 +	gmyth_backend_info_set_hostname(backend_info, gtk_entry_get_text( GTK_ENTRY(entry_hostname) ));
  10.103  	
  10.104 -	g_string_printf(tmp_entry_text, "%s", gtk_entry_get_text( GTK_ENTRY(entry_dbname)));
  10.105 -	gmyth_settings_set_dbname(msettings, tmp_entry_text);
  10.106 +	gmyth_backend_info_set_db_name(backend_info, gtk_entry_get_text( GTK_ENTRY(entry_dbname)));
  10.107  	
  10.108 -	g_string_printf(tmp_entry_text, "%s", gtk_entry_get_text( GTK_ENTRY(entry_username)));
  10.109 -	gmyth_settings_set_username(msettings, tmp_entry_text);
  10.110 +	gmyth_backend_info_set_username(backend_info, gtk_entry_get_text( GTK_ENTRY(entry_username)));
  10.111 +
  10.112 +	gmyth_backend_info_set_password(backend_info, gtk_entry_get_text( GTK_ENTRY(entry_passwd)));
  10.113  	
  10.114 -	g_string_printf(tmp_entry_text, "%s", gtk_entry_get_text( GTK_ENTRY(entry_passwd)));
  10.115 -	gmyth_settings_set_password(msettings, tmp_entry_text);	
  10.116 +	gmyth_backend_info_set_port(backend_info, (gint)g_ascii_strtoull( gtk_entry_get_text( GTK_ENTRY(entry_port) ), 
  10.117 +				NULL, 10) );
  10.118  	
  10.119 -	g_string_printf(tmp_entry_text, "%s", gtk_entry_get_text( GTK_ENTRY(entry_port)));
  10.120 -	gmyth_settings_set_backend_port(msettings, atoi(tmp_entry_text->str));
  10.121 -	
  10.122 -	gmyth_settings_save (msettings);
  10.123 +	//gmyth_backend_info_save (backend_info);
  10.124  	
  10.125  }