diff options
Diffstat (limited to 'src/plugins/daemon/daemon.c')
-rw-r--r-- | src/plugins/daemon/daemon.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/plugins/daemon/daemon.c b/src/plugins/daemon/daemon.c index ab765fab..91325f8c 100644 --- a/src/plugins/daemon/daemon.c +++ b/src/plugins/daemon/daemon.c | |||
@@ -43,7 +43,7 @@ static void updateAppModelSafe(void * unused) { | |||
43 | char * next; | 43 | char * next; |
44 | char * pos; | 44 | char * pos; |
45 | char * desc; | 45 | char * desc; |
46 | 46 | ||
47 | model = gtk_list_store_new(2, | 47 | model = gtk_list_store_new(2, |
48 | G_TYPE_STRING, | 48 | G_TYPE_STRING, |
49 | G_TYPE_STRING); | 49 | G_TYPE_STRING); |
@@ -56,7 +56,7 @@ static void updateAppModelSafe(void * unused) { | |||
56 | "GNUNETD", | 56 | "GNUNETD", |
57 | "APPLICATIONS"); | 57 | "APPLICATIONS"); |
58 | } | 58 | } |
59 | if (apps != NULL) { | 59 | if (apps != NULL) { |
60 | next = apps; | 60 | next = apps; |
61 | do { | 61 | do { |
62 | while (*next == ' ') | 62 | while (*next == ' ') |
@@ -85,8 +85,8 @@ static void updateAppModelSafe(void * unused) { | |||
85 | 1, dgettext("GNUnet", desc), | 85 | 1, dgettext("GNUnet", desc), |
86 | -1); | 86 | -1); |
87 | FREENONNULL(desc); | 87 | FREENONNULL(desc); |
88 | } | 88 | } |
89 | } while (next != NULL); | 89 | } while (next != NULL); |
90 | FREE(apps); | 90 | FREE(apps); |
91 | } | 91 | } |
92 | w = glade_xml_get_widget(getMainXML(), | 92 | w = glade_xml_get_widget(getMainXML(), |
@@ -119,10 +119,10 @@ static void doUpdateMenus(void * arg) { | |||
119 | launchEntry | 119 | launchEntry |
120 | = glade_xml_get_widget(getMainXML(), | 120 | = glade_xml_get_widget(getMainXML(), |
121 | "startDaemon"); | 121 | "startDaemon"); |
122 | statsEntryYes | 122 | statsEntryYes |
123 | = glade_xml_get_widget(getMainXML(), | 123 | = glade_xml_get_widget(getMainXML(), |
124 | "statusPixmapYes"); | 124 | "statusPixmapYes"); |
125 | statsEntryNo | 125 | statsEntryNo |
126 | = glade_xml_get_widget(getMainXML(), | 126 | = glade_xml_get_widget(getMainXML(), |
127 | "statusPixmapNo"); | 127 | "statusPixmapNo"); |
128 | host = getConfigurationString("NETWORK", | 128 | host = getConfigurationString("NETWORK", |
@@ -145,22 +145,22 @@ static void doUpdateMenus(void * arg) { | |||
145 | gtk_widget_show_all(statsEntryYes); | 145 | gtk_widget_show_all(statsEntryYes); |
146 | gtk_widget_set_sensitive(killEntry, TRUE); | 146 | gtk_widget_set_sensitive(killEntry, TRUE); |
147 | gtk_widget_set_sensitive(launchEntry, FALSE); | 147 | gtk_widget_set_sensitive(launchEntry, FALSE); |
148 | } | 148 | } |
149 | } | 149 | } |
150 | 150 | ||
151 | static void cronCheckDaemon(void * dummy) { | 151 | static void cronCheckDaemon(void * dummy) { |
152 | static int last = 42; | 152 | static int last = 42; |
153 | int ret; | 153 | int ret; |
154 | 154 | ||
155 | ret = checkGNUnetDaemonRunning(); | 155 | ret = checkGNUnetDaemonRunning(); |
156 | if (ret != last) { | 156 | if (ret != last) { |
157 | last = ret; | 157 | last = ret; |
158 | gtkSaveCall(&doUpdateMenus, &ret); | 158 | gtkSaveCall(&doUpdateMenus, &ret); |
159 | } | 159 | } |
160 | } | 160 | } |
161 | 161 | ||
162 | 162 | ||
163 | /** | 163 | /** |
164 | * Launch gnunetd w/ checks | 164 | * Launch gnunetd w/ checks |
165 | */ | 165 | */ |
166 | void on_startDaemon_clicked(GtkWidget * widget, | 166 | void on_startDaemon_clicked(GtkWidget * widget, |
@@ -183,7 +183,7 @@ void on_startDaemon_clicked(GtkWidget * widget, | |||
183 | } | 183 | } |
184 | } | 184 | } |
185 | 185 | ||
186 | /** | 186 | /** |
187 | * Kill gnunetd | 187 | * Kill gnunetd |
188 | */ | 188 | */ |
189 | void on_stopDaemon_clicked(GtkWidget * widget, | 189 | void on_stopDaemon_clicked(GtkWidget * widget, |
@@ -193,23 +193,23 @@ void on_stopDaemon_clicked(GtkWidget * widget, | |||
193 | = glade_xml_get_widget(getMainXML(), | 193 | = glade_xml_get_widget(getMainXML(), |
194 | "stopDaemon"); | 194 | "stopDaemon"); |
195 | gtk_widget_set_sensitive(killEntry, FALSE); | 195 | gtk_widget_set_sensitive(killEntry, FALSE); |
196 | 196 | ||
197 | if (OK == checkGNUnetDaemonRunning() ) { | 197 | if (OK == checkGNUnetDaemonRunning() ) { |
198 | if (OK != stopGNUnetDaemon()) { | 198 | if (OK != stopGNUnetDaemon()) { |
199 | GtkWidget * dialog; | 199 | GtkWidget * dialog; |
200 | 200 | ||
201 | dialog = gtk_message_dialog_new | 201 | dialog = gtk_message_dialog_new |
202 | (NULL, | 202 | (NULL, |
203 | GTK_DIALOG_MODAL, | 203 | GTK_DIALOG_MODAL, |
204 | GTK_MESSAGE_ERROR, | 204 | GTK_MESSAGE_ERROR, |
205 | GTK_BUTTONS_CLOSE, | 205 | GTK_BUTTONS_CLOSE, |
206 | _("Error requesting shutdown of gnunetd.")); | 206 | _("Error requesting shutdown of gnunetd.")); |
207 | gtk_dialog_run(GTK_DIALOG(dialog)); | 207 | gtk_dialog_run(GTK_DIALOG(dialog)); |
208 | gtk_widget_destroy(dialog); | 208 | gtk_widget_destroy(dialog); |
209 | } else { | 209 | } else { |
210 | addLogEntry(_("Terminating gnunetd...")); | 210 | addLogEntry(_("Terminating gnunetd...")); |
211 | } | 211 | } |
212 | } | 212 | } |
213 | cronCheckDaemon(NULL); | 213 | cronCheckDaemon(NULL); |
214 | } | 214 | } |
215 | 215 | ||
@@ -245,7 +245,7 @@ void init_daemon() { | |||
245 | = glade_xml_get_widget(getMainXML(), | 245 | = glade_xml_get_widget(getMainXML(), |
246 | "daemonScrolledWindow"); | 246 | "daemonScrolledWindow"); |
247 | gtk_widget_show(tab); | 247 | gtk_widget_show(tab); |
248 | addCronJob(&cronCheckDaemon, | 248 | addCronJob(&cronCheckDaemon, |
249 | 0, | 249 | 0, |
250 | 15 * cronSECONDS, | 250 | 15 * cronSECONDS, |
251 | NULL); | 251 | NULL); |
@@ -256,7 +256,7 @@ void init_daemon() { | |||
256 | } | 256 | } |
257 | 257 | ||
258 | void done_daemon() { | 258 | void done_daemon() { |
259 | delCronJob(&cronCheckDaemon, | 259 | delCronJob(&cronCheckDaemon, |
260 | 15 * cronSECONDS, | 260 | 15 * cronSECONDS, |
261 | NULL); | 261 | NULL); |
262 | delCronJob(&updateAppModel, | 262 | delCronJob(&updateAppModel, |