aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/calendar-conduit-control-applet.c
diff options
context:
space:
mode:
authorEskil Heyn Olsen <eskil@src.gnome.org>1999-10-22 09:16:15 +0800
committerEskil Heyn Olsen <eskil@src.gnome.org>1999-10-22 09:16:15 +0800
commit47f01927e15b6eb279d2cbf046b2707467096666 (patch)
tree9a61c996094c07640cad5f1d77b0956e4f361b48 /calendar/calendar-conduit-control-applet.c
parent0a505aa40e7504dec10119c0bb4c84087e3d06d4 (diff)
downloadgsoc2013-evolution-47f01927e15b6eb279d2cbf046b2707467096666.tar.gz
gsoc2013-evolution-47f01927e15b6eb279d2cbf046b2707467096666.tar.zst
gsoc2013-evolution-47f01927e15b6eb279d2cbf046b2707467096666.zip
now it doesn't build todo conduit anymore. Since the conduit is just a
* Makefile.am: now it doesn't build todo conduit anymore. Since the conduit is just a skeleton, no need to build and install it. * calendar-conduit-control-applet.c: revamped for all the changes in calendar-conduit.h. Also fixed the pilotId bug that all conduit capplets had. * calendar-conduit-control-applet.desktop: renamed to GnomeCalendar. * calendar-conduit.h: Fixed namespace pollution, appended GCal to structures, gcalconduit to methods. Introduced the GCalConduitContext. * calendar-conduit.c: No more global variables, all is contained in a GCalConduitContext variable, that all the signals are passed as user data. svn path=/trunk/; revision=1338
Diffstat (limited to 'calendar/calendar-conduit-control-applet.c')
-rw-r--r--calendar/calendar-conduit-control-applet.c70
1 files changed, 39 insertions, 31 deletions
diff --git a/calendar/calendar-conduit-control-applet.c b/calendar/calendar-conduit-control-applet.c
index 4b18ae920f..57f4a07cc8 100644
--- a/calendar/calendar-conduit-control-applet.c
+++ b/calendar/calendar-conduit-control-applet.c
@@ -32,18 +32,21 @@ GtkWidget *dialogWindow=NULL;
gboolean activated,org_activation_state;
GnomePilotConduitMgmt *conduit;
-static void doTrySettings(GtkWidget *widget, ConduitCfg *conduitCfg);
-static void doRevertSettings(GtkWidget *widget, ConduitCfg *conduitCfg);
-static void doSaveSettings(GtkWidget *widget, ConduitCfg *conduitCfg);
+static void doTrySettings(GtkWidget *widget, GCalConduitCfg *conduitCfg);
+static void doRevertSettings(GtkWidget *widget, GCalConduitCfg *conduitCfg);
+static void doSaveSettings(GtkWidget *widget, GCalConduitCfg *conduitCfg);
static void readStateCfg(GtkWidget *w);
static void setStateCfg(GtkWidget *w);
-gchar *pilotId;
+GCalConduitCfg *origState = NULL;
+GCalConduitCfg *curState = NULL;
+
+gint pilotId;
CORBA_Environment ev;
static void
-doTrySettings(GtkWidget *widget, ConduitCfg *conduitCfg)
+doTrySettings(GtkWidget *widget, GCalConduitCfg *conduitCfg)
{
readStateCfg(cfgStateWindow);
if(activated)
@@ -53,15 +56,15 @@ doTrySettings(GtkWidget *widget, ConduitCfg *conduitCfg)
}
static void
-doSaveSettings(GtkWidget *widget, ConduitCfg *conduitCfg)
+doSaveSettings(GtkWidget *widget, GCalConduitCfg *conduitCfg)
{
doTrySettings(widget, conduitCfg);
- save_configuration(NULL);
+ gcalconduit_save_configuration(conduitCfg);
}
static void
-doRevertSettings(GtkWidget *widget, ConduitCfg *conduitCfg)
+doRevertSettings(GtkWidget *widget, GCalConduitCfg *conduitCfg)
{
activated = org_activation_state;
setStateCfg(cfgStateWindow);
@@ -203,7 +206,7 @@ pilot_capplet_setup(void)
gtk_signal_connect(GTK_OBJECT(capplet), "revert",
GTK_SIGNAL_FUNC(doRevertSettings), NULL);
gtk_signal_connect(GTK_OBJECT(capplet), "ok",
- GTK_SIGNAL_FUNC(doSaveSettings), NULL);
+ GTK_SIGNAL_FUNC(doSaveSettings), curState);
gtk_signal_connect(GTK_OBJECT(capplet), "help",
GTK_SIGNAL_FUNC(about_cb), NULL);
@@ -224,28 +227,29 @@ void run_error_dialog(gchar *mesg,...) {
va_end(ap);
}
-gchar *get_pilot_id_from_gpilotd() {
- gchar **pilots;
- int i;
+gint get_pilot_id_from_gpilotd() {
+ gint *pilots;
+ int i;
- i=0;
- gpilotd_get_pilots(&pilots);
- if(pilots) {
- while(pilots[i]) { g_message("pilot %d = \"%s\"",i,pilots[i]); i++; }
- if(i==0) {
- run_error_dialog(_("No pilot configured, please choose the\n'Pilot Link Properties' capplet first."));
- return NULL;
- } else
- if(i==1)
- return pilots[0];
- else {
- g_message("too many pilots...");
- return pilots[0];
- }
- } else {
- run_error_dialog(_("No pilot configured, please choose the\n'Pilot Link Properties' capplet first."));
- return NULL;
- }
+ i=0;
+ gpilotd_get_pilot_ids(&pilots);
+ if(pilots) {
+ while(pilots[i]!=-1) { g_message("pilot %d = \"%d\"",i,pilots[i]); i++; }
+ if(i==0) {
+ run_error_dialog(_("No pilot configured, please choose the\n'Pilot Link Properties' capplet first."));
+ return -1;
+ } else {
+ if(i==1)
+ return pilots[0];
+ else {
+ g_message("too many pilots...");
+ return pilots[0];
+ }
+ }
+ } else {
+ run_error_dialog(_("No pilot configured, please choose the\n'Pilot Link Properties' capplet first."));
+ return -1;
+ }
}
int
@@ -276,6 +280,11 @@ main( int argc, char *argv[] )
pilotId = get_pilot_id_from_gpilotd();
if(!pilotId) return -1;
+
+ /* put all code to set things up in here */
+ gcalconduit_load_configuration(&origState,pilotId);
+ curState = gcalconduit_dupe_configuration(origState);
+
org_activation_state = activated = gpilotd_conduit_mgmt_is_enabled(conduit,pilotId);
pilot_capplet_setup();
@@ -283,6 +292,5 @@ main( int argc, char *argv[] )
/* done setting up, now run main loop */
capplet_gtk_main();
- g_free(pilotId);
return 0;
}