~alanbell/dasher/ircfix-lp579181

« back to all changes in this revision

Viewing changes to Src/Gtk2/DasherAppSettings.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-02-13 08:08:15 UTC
  • mfrom: (1.2.17 upstream)
  • Revision ID: james.westby@ubuntu.com-20070213080815-bpx0yjnzkwfamvi8
Tags: 4.3.4-0ubuntu1
* New upstream release:
  - Updated rendering routines
  - General tidying of gobject implemenatations
  - Translation updates
* debian/rules: 
  - build with --enable-joystick.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
// FIXME - should really do something to make this a singleton class
20
20
 
 
21
// TODO: Rename this file to fit in with naming conventions
 
22
 
 
23
// TODO: Bring this into the widget
 
24
static GtkWidget *pDasherWidget = NULL;
 
25
 
 
26
 
21
27
struct _DasherAppSettingsPrivate {
22
28
#ifdef WITH_GCONF
23
29
  // GConf interface
100
106
void dasher_app_settings_set_widget(DasherAppSettings *pSelf, GtkDasherControl *pWidget) {
101
107
  DasherAppSettingsPrivate *pPrivate = (DasherAppSettingsPrivate*)(pSelf->private_data);
102
108
 
 
109
  pDasherWidget = GTK_WIDGET(pWidget);
 
110
 
103
111
  pPrivate->pWidget = pWidget;
104
112
  pPrivate->bWidgetSet = TRUE;
105
113
}
222
230
    return;
223
231
  }
224
232
  else {
225
 
    pre_parameter_notification(0, iParameter, 0);
 
233
    //    pre_parameter_notification(0, iParameter, 0);
226
234
    
227
235
    if(iParameter < END_OF_APP_BPS)
228
236
      app_boolparamtable[ iParameter - FIRST_APP_BP ].value = app_boolparamtable[ iParameter - FIRST_APP_BP ].bDefaultValue;
256
264
void dasher_app_settings_set_bool(DasherAppSettings *pSelf, int iParameter, bool bValue) {
257
265
  DasherAppSettingsPrivate *pPrivate = (DasherAppSettingsPrivate *)(pSelf->private_data);
258
266
 
259
 
  if( iParameter < END_OF_BPS )
 
267
  if( iParameter < END_OF_BPS ) {
260
268
    if(pPrivate->bWidgetSet) {
261
269
      gtk_dasher_control_set_parameter_bool(GTK_DASHER_CONTROL(pDasherWidget), iParameter, bValue);
262
270
    }
 
271
  }
263
272
  else {
264
273
    if(dasher_app_settings_get_bool(pSelf, iParameter) == bValue)
265
274
      return; // Don't attempt to change to the existing value
266
 
   
267
 
    pre_parameter_notification(0, iParameter, 0);
268
275
 
269
276
    app_boolparamtable[ iParameter - FIRST_APP_BP ].value = bValue;
270
277
#ifdef WITH_GCONF    
276
283
      
277
284
      GError *pGConfError = NULL;
278
285
      gconf_client_set_bool(pPrivate->pGConfClient, szName, bValue, &pGConfError);
 
286
 
 
287
      if(pGConfError)
 
288
        g_message("Error");
279
289
    }
280
290
#endif
281
291
 
308
318
    if(dasher_app_settings_get_long(pSelf, iParameter) == iValue)
309
319
      return; // Don't attempt to change to the existing value
310
320
    
311
 
    pre_parameter_notification(0, iParameter, 0);
 
321
    //    pre_parameter_notification(0, iParameter, 0);
312
322
 
313
323
    app_longparamtable[ iParameter - FIRST_APP_LP ].value = iValue;
314
324
 
388
398
    if(!strcmp(dasher_app_settings_get_string(pSelf, iParameter), szValue))
389
399
      return; // Don't attempt to change to the existing value
390
400
 
391
 
    pre_parameter_notification(0, iParameter, 0);
 
401
    //    pre_parameter_notification(0, iParameter, 0);
392
402
    
393
403
    delete[] app_stringparamtable[ iParameter - FIRST_APP_SP ].value;
394
404
    
481
491
    g_warning("Could not launch gconf-editor: %s", pError->message);
482
492
  }
483
493
}
 
494
 
 
495
void dasher_app_settings_set_widget(DasherAppSettings *pSelf, GtkWidget *pWidget) {
 
496
  pDasherWidget = pWidget;
 
497
}
 
498
 
 
499
GArray *dasher_app_settings_get_allowed_values(DasherAppSettings *pSelf, int iParameter) {
 
500
  return gtk_dasher_control_get_allowed_values(GTK_DASHER_CONTROL(pDasherWidget), iParameter);
 
501
}
 
502
 
 
503
gboolean dasher_app_settings_get_module_settings(DasherAppSettings *pSelf, const gchar *szValue, SModuleSettings **pSettings, gint *iCount) {
 
504
  return gtk_dasher_control_get_module_settings(GTK_DASHER_CONTROL(pDasherWidget), szValue, pSettings, iCount);
 
505
}