Merge lp:~noskcaj/ubuntu/trusty/xfce4-cellmodem-plugin/merge-5 into lp:ubuntu/trusty/xfce4-cellmodem-plugin

Proposed by Jackson Doak
Status: Needs review
Proposed branch: lp:~noskcaj/ubuntu/trusty/xfce4-cellmodem-plugin/merge-5
Merge into: lp:ubuntu/trusty/xfce4-cellmodem-plugin
Diff against target: 2067 lines (+148/-1807)
13 files modified
.pc/01_typo-linking.patch/panel-plugin/Makefile.am (+0/-52)
.pc/02_explicit-linking-to-libxfcegui4.patch/configure.ac (+0/-61)
.pc/02_explicit-linking-to-libxfcegui4.patch/panel-plugin/Makefile.am (+0/-52)
.pc/03_fix-crash-on-remove.patch/panel-plugin/cellmodem.c (+0/-1624)
.pc/applied-patches (+0/-3)
configure.ac (+0/-2)
debian/changelog (+42/-0)
debian/control (+5/-5)
debian/patches/04_port-to-libxfce4ui.patch (+94/-0)
debian/patches/series (+1/-0)
debian/rules (+2/-2)
panel-plugin/Makefile.am (+3/-5)
panel-plugin/cellmodem.c (+1/-1)
To merge this branch: bzr merge lp:~noskcaj/ubuntu/trusty/xfce4-cellmodem-plugin/merge-5
Reviewer Review Type Date Requested Status
Daniel Holbach (community) Approve
Review via email: mp+199216@code.launchpad.net

Description of the change

Merge from debian.

To post a comment you must log in.
Revision history for this message
Daniel Holbach (dholbach) wrote :

Thanks. Uploaded.

review: Approve

Unmerged revisions

16. By Jackson Doak

fix versioning

15. By Jackson Doak

Really fix maintainer

14. By Jackson Doak

Fix maintainer

13. By Jackson Doak

Merge from debian. Remaining changes:

12. By Jackson Doak

Merge latest ubuntu release

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed directory '.pc/01_typo-linking.patch'
2=== removed directory '.pc/01_typo-linking.patch/panel-plugin'
3=== removed file '.pc/01_typo-linking.patch/panel-plugin/Makefile.am'
4--- .pc/01_typo-linking.patch/panel-plugin/Makefile.am 2011-06-27 22:39:05 +0000
5+++ .pc/01_typo-linking.patch/panel-plugin/Makefile.am 1970-01-01 00:00:00 +0000
6@@ -1,52 +0,0 @@
7-plugindir = $(libexecdir)/xfce4/panel-plugins
8-plugin_PROGRAMS = xfce4-cellmodem-plugin
9-
10-xfce4_cellmodem_plugin_CFLAGS = \
11- -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
12- @LIBXFCE4PANEL_CFLAGS@
13-
14-xfce4_cellmodem_plugin_LDFLAGS = \
15- @LIBXFCE4PANEL_LIBS@
16-
17-xfce4_cellmodem_plugin_SOURCES = \
18- cellmodem.c modem_driver.c \
19- modem_driver_fake.c \
20- modem_driver_generic.c \
21- preferences.c \
22- pin_helper.c \
23- leds.c \
24- autodetect.c
25-
26-noinst_HEADERS = \
27- cellmodem.h \
28- leds.h \
29- modem_driver_generic.h \
30- pin_helper.h \
31- cellmodem_options.h \
32- modem_driver_fake.h \
33- modem_driver.h \
34- preferences.h \
35- big_leds.xpm \
36- med_leds.xpm \
37- autodetect.h
38-
39-
40-desktop_in_in_files = cellmodem.desktop.in.in
41-desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in)
42-
43-desktopdir = $(datadir)/xfce4/panel-plugins
44-@INTLTOOL_DESKTOP_RULE@
45-desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
46-
47-EXTRA_DIST = $(desktop_in_in_files)
48-
49-DISTCLEANFILES = $(desktop_DATA) $(desktop_in_files)
50-
51-# get full path into .desktop file
52-%.desktop.in: %.desktop.in.in
53- sed -e "s^@PLUGIN_PATH@^$(libexecdir)/xfce4/panel-plugins^" \
54- $< > $@
55-
56-xfce4-cellmodem-plugin-hook:
57-
58-
59
60=== removed directory '.pc/02_explicit-linking-to-libxfcegui4.patch'
61=== removed file '.pc/02_explicit-linking-to-libxfcegui4.patch/configure.ac'
62--- .pc/02_explicit-linking-to-libxfcegui4.patch/configure.ac 2011-06-27 22:39:05 +0000
63+++ .pc/02_explicit-linking-to-libxfcegui4.patch/configure.ac 1970-01-01 00:00:00 +0000
64@@ -1,61 +0,0 @@
65-m4_define([cellmodem_version], [0.0.5])
66-
67-AC_INIT([xfce4-cellmodem-plugin], [cellmodem_version()],[alvieboy@alvie.com])
68-
69-
70-CELLMODEM_VERSION=cellmodem_version()
71-AM_INIT_AUTOMAKE([xfce4-cellmodem-plugin], [$CELLMODEM_VERSION])
72-AM_CONFIG_HEADER([config.h])
73-
74-AM_MAINTAINER_MODE
75-AC_ISC_POSIX
76-AC_PROG_CC
77-AC_PROG_INSTALL
78-AC_PROG_INTLTOOL
79-AC_GNU_SOURCE
80-AC_HEADER_STDC
81-
82-AC_CHECK_FUNCS([vasprintf])
83-
84-XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.3.20])
85-XDT_I18N([cs pt])
86-
87-AC_ARG_ENABLE([debug],
88-[ --enable-debug Enable syslog debugging],
89-[enable_debug="yes"],
90-[enable_debug="no"]
91-)
92-
93-if test "$enable_debug" = "yes" ; then
94- echo "Enabling syslog debugging"
95- AC_DEFINE(DEBUG_ENABLED,[1],[Enable debugging through syslog])
96-else
97- echo "> Not using debug"
98-fi
99-
100-# PCI library needs libz.
101-
102-AC_CHECK_HEADER([zlib.h],
103-AC_CHECK_LIB(z,inflate,
104-LIBS="$LIBS -lz"
105-)
106-)
107-
108-AC_CHECK_HEADER([pci/pci.h],
109-AC_CHECK_LIB(pci,pci_alloc,
110-AC_DEFINE(HAVE_PCIUTILS,[1],[Use pci utils to discover devices])
111-LIBS="$LIBS -lpci"
112-)
113-)
114-
115-PKG_CHECK_MODULES(libusb,[libusb >= 0.1.12],
116-AC_DEFINE(HAVE_USBUTILS,[1],[Use usb utils to discover devices])
117-LIBS="$LIBS $libusb_LIBS"
118-,
119-)
120-
121-AC_OUTPUT([
122-Makefile
123-panel-plugin/Makefile
124-po/Makefile.in
125-])
126
127=== removed directory '.pc/02_explicit-linking-to-libxfcegui4.patch/panel-plugin'
128=== removed file '.pc/02_explicit-linking-to-libxfcegui4.patch/panel-plugin/Makefile.am'
129--- .pc/02_explicit-linking-to-libxfcegui4.patch/panel-plugin/Makefile.am 2011-06-27 22:39:05 +0000
130+++ .pc/02_explicit-linking-to-libxfcegui4.patch/panel-plugin/Makefile.am 1970-01-01 00:00:00 +0000
131@@ -1,52 +0,0 @@
132-plugindir = $(libexecdir)/xfce4/panel-plugins
133-plugin_PROGRAMS = xfce4-cellmodem-plugin
134-
135-xfce4_cellmodem_plugin_CFLAGS = \
136- -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
137- @LIBXFCE4PANEL_CFLAGS@
138-
139-xfce4_cellmodem_plugin_LDADD = \
140- @LIBXFCE4PANEL_LIBS@
141-
142-xfce4_cellmodem_plugin_SOURCES = \
143- cellmodem.c modem_driver.c \
144- modem_driver_fake.c \
145- modem_driver_generic.c \
146- preferences.c \
147- pin_helper.c \
148- leds.c \
149- autodetect.c
150-
151-noinst_HEADERS = \
152- cellmodem.h \
153- leds.h \
154- modem_driver_generic.h \
155- pin_helper.h \
156- cellmodem_options.h \
157- modem_driver_fake.h \
158- modem_driver.h \
159- preferences.h \
160- big_leds.xpm \
161- med_leds.xpm \
162- autodetect.h
163-
164-
165-desktop_in_in_files = cellmodem.desktop.in.in
166-desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in)
167-
168-desktopdir = $(datadir)/xfce4/panel-plugins
169-@INTLTOOL_DESKTOP_RULE@
170-desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
171-
172-EXTRA_DIST = $(desktop_in_in_files)
173-
174-DISTCLEANFILES = $(desktop_DATA) $(desktop_in_files)
175-
176-# get full path into .desktop file
177-%.desktop.in: %.desktop.in.in
178- sed -e "s^@PLUGIN_PATH@^$(libexecdir)/xfce4/panel-plugins^" \
179- $< > $@
180-
181-xfce4-cellmodem-plugin-hook:
182-
183-
184
185=== removed directory '.pc/03_fix-crash-on-remove.patch'
186=== removed directory '.pc/03_fix-crash-on-remove.patch/panel-plugin'
187=== removed file '.pc/03_fix-crash-on-remove.patch/panel-plugin/cellmodem.c'
188--- .pc/03_fix-crash-on-remove.patch/panel-plugin/cellmodem.c 2012-05-17 20:09:01 +0000
189+++ .pc/03_fix-crash-on-remove.patch/panel-plugin/cellmodem.c 1970-01-01 00:00:00 +0000
190@@ -1,1624 +0,0 @@
191-/*
192- * Copyright (c) 2006 Alvaro Lopes <alvieboy@alvie.com>
193- *
194- * This program is free software; you can redistribute it and/or modify
195- * it under the terms of the GNU General Public License as published by
196- * the Free Software Foundation; either version 2 of the License, or
197- * (at your option) any later version.
198- *
199- * This program is distributed in the hope that it will be useful,
200- * but WITHOUT ANY WARRANTY; without even the implied warranty of
201- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
202- * GNU General Public License for more details.
203- *
204- * You should have received a copy of the GNU General Public License
205- * along with this program; if not, write to the Free Software
206- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
207- */
208-
209-#include "config.h"
210-#include "cellmodem.h"
211-#include "modem_driver.h"
212-#include "preferences.h"
213-#include "pin_helper.h"
214-
215-/* Prototypes */
216-
217-static gboolean cellmodem_t_send_at_command( cellmodem_t *monitor,
218- modem_reply_callback_t callback,
219- const gchar *command );
220-static gboolean get_network_info( cellmodem_t *monitor );
221-
222-static void cellmodem_t_identify_network( cellmodem_t *monitor );
223-static gboolean cellmodem_t_close_modem(cellmodem_t *monitor /*, gboolean failure */);
224-static gboolean reschedule_open( cellmodem_t *monitor /*, gboolean failure */);
225-static gboolean cellmodem_t_at_command_timeout( cellmodem_t *monitor );
226-static void cellmodem_t_cancel_pending_at_command_timeout( cellmodem_t *monitor );
227-static void cellmodem_t_get_quality( cellmodem_t *monitor );
228-static void cellmodem_t_get_pin_status( cellmodem_t *monitor );
229-static void cellmodem_t_send_pin( cellmodem_t *monitor, const gchar *pin );
230-static void cellmodem_t_set_tooltip_info( cellmodem_t *monitor );
231-static void cellmodem_t_get_ohcip_status( cellmodem_t *monitor );
232-static gboolean cellmodem_button_event(GtkEventBox *box, GdkEventButton *button, cellmodem_t *monitor);
233-static gboolean cellmodem_t_open_modem(cellmodem_t *monitor);
234-static void cellmodem_t_switch_status( cellmodem_t *monitor, modem_status_t status );
235-
236-
237-
238-/* End Proto */
239-
240-/**
241- * @brief [cellmodem_t method] Set display modem error
242- *
243- * @param monitor The monitor object
244- *
245- * @return TRUE if c starts with 'ERROR', FALSE otherwise
246- */
247-
248-
249-static void cellmodem_t_set_error( cellmodem_t *monitor )
250-{
251- led_t_set_color( monitor->status_led, LED_RED );
252- led_t_set_flashing( monitor->status_led, TRUE );
253- led_t_set_color( monitor->network_led, LED_OFF );
254- led_t_set_flashing( monitor->network_led, FALSE );
255-}
256-
257-static void cellmodem_t_set_ok( cellmodem_t *monitor )
258-{
259- led_t_set_color( monitor->status_led, LED_GREEN );
260- led_t_set_flashing( monitor->status_led, FALSE );
261-}
262-
263-static gboolean cellmodem_t_in_error_status( cellmodem_t *monitor )
264-{
265- return monitor->modem_status == MODEM_ERROR;
266-}
267-
268-static void cellmodem_t_switch_to_error( cellmodem_t *monitor,
269- const char *fmt, ... )
270-{
271- va_list ap;
272- va_start( ap, fmt );
273-
274- if ( monitor->lasterror != NULL ) {
275- g_free( monitor->lasterror );
276- }
277-
278- vasprintf( &monitor->lasterror, fmt, ap );
279-
280- va_end( ap );
281-
282- cellmodem_t_switch_status( monitor, MODEM_ERROR );
283- cellmodem_t_set_tooltip_info( monitor );
284-}
285-
286-static void cellmodem_t_switch_to_error_and_restart( cellmodem_t *monitor,
287- const char *fmt, ... )
288-{
289- va_list ap;
290- va_start( ap, fmt );
291-
292- if ( monitor->lasterror != NULL ) {
293- g_free( monitor->lasterror );
294- }
295-
296- vasprintf( &monitor->lasterror, fmt, ap );
297-
298- va_end( ap );
299-
300- cellmodem_t_switch_status( monitor, MODEM_ERROR );
301- cellmodem_t_set_tooltip_info( monitor );
302- reschedule_open( monitor );
303-}
304-
305-
306-static void cellmodem_t_switch_status( cellmodem_t *monitor,
307- modem_status_t status )
308-{
309- DEBUG("Switching modem status from %d to %d",
310- monitor->modem_status, status );
311-
312- switch ( status ) {
313- case MODEM_ERROR:
314- cellmodem_t_set_error( monitor );
315- break;
316- case MODEM_WAIT_CSQ_RESPONSE:
317- case MODEM_WAIT_CPIN_RESPONSE:
318- case MODEM_WAIT_COPS_RESPONSE:
319- case MODEM_WAIT_PINE_RESPONSE:
320- case MODEM_CLOSED:
321- cellmodem_t_set_ok( monitor );
322- break;
323- case MODEM_WAIT_CREG_RESPONSE:
324- case MODEM_WAIT_REGISTRATION:
325- case MODEM_WAIT_OHCIP_RESPONSE:
326- break;
327- }
328-
329- monitor->modem_status = status;
330-}
331-
332-static void cellmodem_t_switch_network_status( cellmodem_t *monitor,
333- registration_type_t status )
334-{
335- switch (status) {
336- case REGISTRATION_UNKNOWN:
337- led_t_set_color( monitor->network_led, LED_YELLOW );
338- led_t_set_flashing( monitor->network_led, FALSE );
339- break;
340- case REGISTRATION_NOT_REGISTERED:
341- led_t_set_color( monitor->network_led, LED_RED );
342- led_t_set_flashing( monitor->network_led, TRUE );
343- break;
344- case REGISTRATION_REGISTERING:
345- led_t_set_color( monitor->network_led, LED_GREEN );
346- led_t_set_flashing( monitor->network_led, TRUE );
347- break;
348- case REGISTRATION_NEEDS_PIN:
349- led_t_set_color( monitor->network_led, LED_YELLOW );
350- led_t_set_flashing( monitor->network_led, TRUE );
351- break;
352- case REGISTRATION_HSDPA:
353- led_t_set_color( monitor->network_led, LED_BLUE );
354- led_t_set_flashing( monitor->network_led, FALSE );
355- break;
356- default:
357- led_t_set_color( monitor->network_led, LED_GREEN );
358- led_t_set_flashing( monitor->network_led, FALSE );
359- }
360-
361- monitor->registration_status = status;
362-
363- cellmodem_t_set_tooltip_info( monitor );
364-}
365-
366-/**
367- * @brief Check if buffer is an error reply from modem
368- *
369- * @param c The buffer to check
370- *
371- * @return TRUE if c starts with 'ERROR', FALSE otherwise
372- */
373-
374-static gboolean
375-is_AT_error_reply( const gchar *c )
376-{
377- if ( strcmp(c,"ERROR") == 0 )
378- return TRUE;
379-
380- /* This is sometimes issued when
381- the card is still initializing */
382- /*
383- Got response: '+CME ERROR: SIM interface not started yet' command 'AT+CPIN?'
384- */
385- if ( strncmp(c,"+CME ERROR",10) == 0 )
386- return TRUE;
387- if ( strcmp(c,"NO CARRIER") == 0 )
388- return TRUE;
389- if ( strcmp(c,"BUSY") == 0 )
390- return TRUE;
391- if ( strcmp(c,"NO DIALTONE") == 0 )
392- return TRUE;
393-
394- return FALSE;
395-}
396-
397-/**
398- * @brief Check if buffer is a success reply from modem
399- *
400- * @param c The buffer to check
401- *
402- * @return TRUE if c starts with 'OK', FALSE otherwise
403- */
404-
405-static gboolean
406-is_AT_success_reply( const gchar *c )
407-{
408- return strcmp(c,"OK") == 0;
409-}
410-/**
411- * @brief Remove leading characters from string
412- *
413- * This will remove all leading chars in string that match the parameter.
414- *
415- * @param buffer The string where to remove the characters
416- * @param c The character
417- *
418- * @return A new pointer to the first valid char
419- */
420-
421-static char *
422-remove_leading_chars( char *buffer, const char *c )
423-{
424- size_t position = 0;
425-
426- while ( buffer[position] > 0 ) {
427- if ( strchr( c, buffer[position] ) > 0 ) {
428- position++;
429- } else {
430- break;
431- }
432- }
433- return buffer + position;
434-}
435-/**
436- * @brief Remove trailing characters from string
437- *
438- * This will remove all trailing chars in string that match the parameter.
439- *
440- * @param buffer The string where to remove the characters
441- * @param c The characters to remove
442- *
443- * @return Nothing
444- */
445-
446-static void
447-remove_trailing_chars( char *buffer, const char *c )
448-{
449- size_t position = strlen(buffer);
450- do {
451- if ( strchr( c, buffer[position] ) > 0 ) {
452- buffer[ position ] = '\0';
453- position--;
454- } else {
455- break;
456- }
457- } while ( position > 0 );
458-}
459-
460-/**
461- * @brief Check if string is empty or contains only spaces
462- *
463- * @param buffer The string where to remove the characters
464- *
465- * @return TRUE if only space chars found, FALSE otherwise
466- */
467-
468-static gboolean
469-is_only_spaces( const char *buffer )
470-{
471- int i;
472-
473- if ( strlen( buffer )==0 )
474- return TRUE;
475-
476- for (i=0; i<strlen(buffer); i++) {
477- if (buffer[i]!=' ')
478- return FALSE;
479- }
480- return TRUE;
481-}
482-
483-/**
484- * @brief [cellmodem_t method] Reset the internal RX buffer
485- * @param monitor The cellmodem object
486- * @return Nothing
487- */
488-
489-static void cellmodem_t_reset_buffer( cellmodem_t *monitor )
490-{
491- monitor->line_buffer_size = 0;
492-}
493-
494-
495-/**
496- * @brief Set the plugin size
497- * DOCUMENT ME PLEASE
498- */
499-
500-static gboolean
501-cellmodem_set_size(XfcePanelPlugin *plugin, int size, cellmodem_t *monitor)
502-{
503- DEBUG("Set size request");
504- if (xfce_panel_plugin_get_orientation (plugin) == GTK_ORIENTATION_HORIZONTAL)
505- {
506- gtk_widget_set_size_request(GTK_WIDGET( monitor->qualpbar ),
507- BORDER, size - 4);
508- }
509- else
510- {
511- gtk_widget_set_size_request(GTK_WIDGET( monitor->qualpbar ),
512- size - 4, BORDER);
513- }
514- DEBUG("Done set size request");
515- return TRUE;
516-}
517-
518-
519-/**
520- * @brief [cellmodem_t method] Setup the main widgets for the panel plugin
521- * @param monitor The cellmodem object
522- * @param destroy If true, destroy the already instanciated objects [will be deprecated]
523- */
524-
525-static void
526-cellmodem_t_setup_widgets( cellmodem_t *monitor, gboolean destroy )
527-{
528- monitor->status_led =
529- led_t_new();
530- monitor->network_led =
531- led_t_new();
532-
533- led_t_set_color( monitor->status_led, LED_OFF );
534-
535- led_t_set_color( monitor->network_led, LED_OFF );
536-
537-
538- /* led_t_set_flashing( monitor->testled, TRUE );*/
539-
540- GtkOrientation orientation =
541- xfce_panel_plugin_get_orientation(monitor->plugin);
542-
543- monitor->tooltips = gtk_tooltips_new();
544- g_object_ref(monitor->tooltips);
545- gtk_object_sink(GTK_OBJECT(monitor->tooltips));
546-
547- monitor->eventbox = gtk_event_box_new();
548- monitor->qualpbar = gtk_progress_bar_new();
549-
550- if (orientation == GTK_ORIENTATION_HORIZONTAL)
551- {
552- gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(monitor->qualpbar),
553- GTK_PROGRESS_BOTTOM_TO_TOP);
554-
555- monitor->gbox = gtk_hbox_new(FALSE, 0);
556- monitor->box=gtk_hbox_new(FALSE, 0);
557- } else {
558- gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(monitor->qualpbar),
559- GTK_PROGRESS_LEFT_TO_RIGHT);
560-
561- monitor->gbox = gtk_vbox_new(FALSE, 0);
562- monitor->box=gtk_vbox_new(FALSE, 0);
563- }
564-
565-
566- gtk_container_set_border_width(GTK_CONTAINER(monitor->box), BORDER/2);
567-
568- gtk_box_pack_start(GTK_BOX(monitor->box),
569- GTK_WIDGET(monitor->qualpbar),
570- FALSE, FALSE, 0);
571-
572-
573- /* LEDS */
574- GtkWidget *led_box;
575-
576- if (orientation == GTK_ORIENTATION_HORIZONTAL)
577- {
578- led_box = gtk_vbox_new(FALSE,0);
579- } else {
580- led_box = gtk_hbox_new(FALSE,0);
581- }
582-
583-
584- gtk_box_pack_start(GTK_BOX(led_box),
585- GTK_WIDGET(monitor->status_led->image),
586- FALSE, FALSE, 0);
587- gtk_widget_show( monitor->status_led->image );
588-
589- gtk_box_pack_start(GTK_BOX(led_box),
590- GTK_WIDGET(monitor->network_led->image),
591- FALSE, FALSE, 0);
592- gtk_widget_show( monitor->network_led->image );
593-
594- gtk_box_pack_start(GTK_BOX(monitor->box),
595- led_box, FALSE,FALSE,0);
596-
597- gtk_box_set_spacing(GTK_BOX(led_box), BORDER/4);
598-
599-
600- gtk_widget_show( led_box );
601-
602- gtk_box_pack_start(GTK_BOX(monitor->gbox),
603- GTK_WIDGET(monitor->box), FALSE, FALSE, 0);
604-
605-
606- gtk_widget_show( monitor->box );
607- gtk_widget_show( monitor->gbox );
608-
609- gtk_widget_show( monitor->qualpbar );
610-
611- gtk_container_add(GTK_CONTAINER(monitor->eventbox),
612- GTK_WIDGET(monitor->gbox));
613-
614- gtk_widget_show(monitor->eventbox);
615- gtk_widget_set_size_request(monitor->eventbox, -1, -1);
616-
617- gtk_signal_connect( GTK_OBJECT(monitor->eventbox), "button-press-event", G_CALLBACK (cellmodem_button_event), monitor );
618-
619-}
620-/**
621- * @brief [cellmodem_t CTOR] Create a new cellmodem object
622- * Creates the new cellmodem object, setting up some default values
623- *
624- * @param plugin The relevant XfcePanelPlugin
625- * @return The newly created cellmodem object
626- */
627-
628-static cellmodem_t *
629-cellmodem_t_new(XfcePanelPlugin *plugin)
630-{
631- cellmodem_t *monitor;
632-
633- monitor = g_new0(cellmodem_t, 1);
634-
635- monitor->plugin = plugin;
636- monitor->lasterror = NULL;
637- monitor->lastcmd = g_new( gchar, 128 );
638-
639- monitor->options.modem_device = NULL;
640- monitor->options.critical_threshold = 20;
641- monitor->options.low_threshold = 40;
642- monitor->options.max_quality = MAX_QUAL;
643-
644-
645- /* Setup colors */
646-
647- gdk_color_parse("#ff0000", &(monitor->red_color));
648- gdk_color_parse("#ffff00", &(monitor->yellow_color));
649- gdk_color_parse("#00ff00", &(monitor->green_color));
650-
651- cellmodem_t_setup_widgets( monitor, FALSE );
652-
653- cellmodem_t_switch_to_error( monitor, _("Initializing plugin now") );
654-
655- cellmodem_t_switch_network_status( monitor, REGISTRATION_UNKNOWN );
656-
657- return monitor;
658-}
659-
660-/**
661- * @brief [cellmodem_t member] Update tooltips according to status
662- *
663- * @param monitor The cellmodem object
664- */
665-
666-static void
667-cellmodem_t_set_tooltip_info( cellmodem_t *monitor )
668-{
669- gchar buffer[512];
670-
671- gint qp = monitor->quality*100;
672- gint q = monitor->signal_strength;
673-
674- if ( cellmodem_t_in_error_status ( monitor ) )
675- {
676- g_snprintf( buffer, 512, _("Error detected:\n%s"), monitor->lasterror );
677- }
678- else {
679- switch( monitor->registration_status )
680- {
681- case REGISTRATION_NOT_REGISTERED:
682- g_snprintf(buffer, 512, _("Not registered"));
683- break;
684- case REGISTRATION_NEEDS_PIN:
685- g_snprintf(buffer, 512, _("Modem needs PIN"));
686- break;
687- case REGISTRATION_REGISTERING:
688- g_snprintf(buffer, 512, _("Registering"));
689- break;
690- case REGISTRATION_GPRS:
691- g_snprintf(buffer, 512, _("Registered [GPRS] to %s\nQuality: %d (%d%%)"), monitor->network, q,qp );
692- break;
693- case REGISTRATION_UMTS:
694- g_snprintf(buffer, 512, _("Registered [UMTS] to %s\nQuality: %d (%d%%)"), monitor->network,q,qp );
695- break;
696- case REGISTRATION_HSDPA:
697- g_snprintf(buffer, 512, _("Registered [HSDPA] to %s\nQuality: %d (%d%%)"), monitor->network,q,qp );
698- break;
699- case REGISTRATION_UNKNOWN:
700- g_snprintf(buffer, 512, _("Registered to %s\nQuality: %d (%d%%)"), monitor->network,q,qp);
701- break;
702- }
703- }
704-
705- gtk_tooltips_set_tip (monitor->tooltips, monitor->eventbox, buffer, NULL);
706-}
707-
708-
709-/**
710- * @brief [cellmodem_t member] Set the quality bar color
711- *
712- * @param monitor The cellmodem object
713- * @param color The required GdkColor * color
714- */
715-
716-
717-static void
718-cellmodem_t_set_bar_color(cellmodem_t *monitor, GdkColor *color )
719-{
720- gtk_widget_modify_bg( monitor->qualpbar, GTK_STATE_PRELIGHT, color );
721-}
722-
723-/**
724- * @brief [cellmodem_t member] Update the progress bar
725- *
726- * @param monitor The cellmodem object
727- */
728-
729-
730-static void
731-cellmodem_t_update_progressbar( cellmodem_t *monitor )
732-{
733- gint qual = (gint)(100.0*monitor->quality);
734-
735- if ( monitor->registration_status == REGISTRATION_NOT_REGISTERED ) {
736- gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(monitor->qualpbar), 0.0 );
737- cellmodem_t_set_bar_color( monitor, NULL );
738- }
739- else {
740-
741- if( qual <= monitor->options.critical_threshold ) {
742- cellmodem_t_set_bar_color( monitor, &(monitor->red_color) );
743- }
744- else if( qual <= monitor->options.low_threshold ) {
745- cellmodem_t_set_bar_color( monitor, &(monitor->yellow_color) );
746- }
747- else {
748- cellmodem_t_set_bar_color( monitor, &(monitor->green_color) );
749- }
750- }
751-
752- gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(monitor->qualpbar), monitor->quality );
753-
754-}
755-/**
756- * @brief [cellmodem_t member] Update the monitors
757- *
758- * This will update the progressbar and the tooltips
759- *
760- * @param monitor The cellmodem object
761- */
762-
763-static void
764-cellmodem_t_update_monitors( cellmodem_t *monitor )
765-{
766- cellmodem_t_set_tooltip_info( monitor );
767- cellmodem_t_update_progressbar( monitor );
768-}
769-
770-/**
771- * @brief [cellmodem_t DTOR] Destroy the cellmodem object
772- *
773- * @param monitor The cellmodem object
774- *
775- * @return Nothing
776- */
777-
778-static void
779-cellmodem_t_delete(cellmodem_t *monitor)
780-{
781- DEBUG("Destroying cellmodem object");
782- cellmodem_t_close_modem( monitor /*, TRUE*/ );
783-
784- g_object_unref (monitor->tooltips);
785-
786- g_free( monitor->lastcmd );
787-
788- g_free(monitor);
789-}
790-
791-/**
792- * @brief [cellmodem_t member] Close the modem channel
793- *
794- * @param monitor The cellmodem object
795- *
796- * @return TRUE if modem sucessfuly closed, FALSE if not opened or error
797- */
798-
799-static gboolean
800-cellmodem_t_close_modem(cellmodem_t *monitor /*, gboolean failure */)
801-{
802- if (NULL == monitor->modem_instance)
803- return FALSE;
804-
805- if (NULL == monitor->driver)
806- return FALSE;
807-
808- monitor->driver->close(monitor->modem_instance);
809-
810- return TRUE;
811-}
812-
813-static void pin_callback( const gchar *pin, void *pvt )
814-{
815- cellmodem_t *monitor = (cellmodem_t *)pvt;
816-
817- cellmodem_t_send_pin( monitor, pin );
818-}
819-
820-static void
821-cellmodem_t_request_pin( cellmodem_t *monitor )
822-{
823- /*
824- if ( monitor->options.ask_for_pin )
825- pin_helper_launch( GTK_WIDGET(monitor->plugin), pin_callback, monitor );
826- else {
827- */
828- cellmodem_t_switch_status( monitor, MODEM_CLOSED );
829- cellmodem_t_switch_network_status( monitor, REGISTRATION_NEEDS_PIN );
830-
831- /* End here */
832-
833- cellmodem_t_close_modem( monitor );
834-
835-}
836-
837-
838-/**
839- * @brief [cellmodem_t pseudo-member] Callback for registration request
840- *
841- * @param success TRUE if modem replied OK, FALSE otherwise
842- * @param response GString with modem response
843- * @param pvt Pointer to cellmodem object
844- *
845- * pvt will be deferenced to cellmodem object upon calling. No typechecking is done.
846- *
847- *
848- * @return Nothing
849- */
850-
851-static void
852-cellmodem_t_registration_callback(gboolean success, GString *response, void *pvt)
853-{
854- cellmodem_t *monitor = (cellmodem_t*)pvt;
855-
856- if ( !success || response==NULL || response->str==NULL ) {
857- /* Error */
858- cellmodem_t_switch_to_error_and_restart( monitor, _("Error in modem reply to CREG") );
859- return;
860- }
861-
862- DEBUG("Got registration callback: %s", response->str);
863- if ( strncmp( response->str ,"+CREG: ", 7 )==0 ) {
864-
865- gchar *start = response->str + 7;
866- if ( strtok( start, ",") == NULL) {
867- cellmodem_t_switch_to_error_and_restart( monitor, _("Invalid reply to +CREG") );
868- return;
869- }
870- gchar *delim = strtok ( NULL, "," );
871-
872- int i = atoi( delim );
873-
874- DEBUG("Registration reply: %d", i);
875-
876- switch (i) {
877- case 1:
878-
879- /* We only should switch status here after +COPS response */
880-
881- cellmodem_t_switch_network_status( monitor, REGISTRATION_UNKNOWN );
882- break;
883- case 2:
884- cellmodem_t_switch_network_status( monitor, REGISTRATION_REGISTERING );
885- break;
886- default:
887- cellmodem_t_switch_network_status( monitor, REGISTRATION_NOT_REGISTERED );
888- break;
889- }
890- } else {
891- DEBUG("Modem error in reply");
892- cellmodem_t_switch_to_error_and_restart( monitor, _("Invalid CREG reply from modem") );
893- return;
894- }
895-
896-
897- if ( monitor->registration_status != REGISTRATION_NOT_REGISTERED &&
898- monitor->registration_status != REGISTRATION_REGISTERING ) {
899-
900- cellmodem_t_identify_network( monitor );
901-
902- } else {
903- /* Check for PIN ????? */
904- cellmodem_t_get_pin_status( monitor );
905- /*else
906- reschedule_open( monitor, FALSE );
907- */
908- }
909-}
910-/**
911- * @brief [cellmodem_t pseudo-member] Callback for network id request
912- *
913- * @param success TRUE if modem replied OK, FALSE otherwise
914- * @param response GString with modem response
915- * @param pvt Pointer to cellmodem object
916- *
917- * pvt will be deferenced to cellmodem object upon calling. No typechecking is done.
918- *
919- * @return Nothing
920- */
921-
922-static void
923-cellmodem_t_identify_callback(gboolean success, GString *response, void *pvt)
924-{
925- cellmodem_t *monitor = (cellmodem_t*)pvt;
926-
927- if ( !success || response==NULL || response->str==NULL ) {
928- /* Error */
929- DEBUG("Modem error detected (%p)", pvt);
930- cellmodem_t_switch_to_error_and_restart( monitor, _("Error in modem reply to COPS") );
931- return;
932- }
933-
934- /* +COPS: 0,0,"Provider",2 */
935- if ( strncmp(response->str,"+COPS: ", 7 )==0 ) {
936- gchar *start = response->str + 7;
937- gchar *tok[64];
938- int i=0;
939-
940- tok[i++] = strtok( start, ",");
941- while ( ( tok[i++]=strtok(NULL,",")) ) {};
942-
943- DEBUG("Network: '%s'\n", tok[2]);
944- DEBUG("Network Type: '%s'\n", tok[3]);
945-
946- if ( monitor->network )
947- g_free( monitor->network );
948-
949- if (tok[2][0]=='"') {
950- monitor->network = g_strndup( tok[2]+1, strlen(tok[2])-2 );
951- } else {
952- monitor->network = g_strdup( tok[2] );
953- }
954-
955- if ( monitor->registration_status != REGISTRATION_NOT_REGISTERED )
956- {
957- int type = atoi(tok[3]);
958-
959- switch (type) {
960- case 0:
961- cellmodem_t_switch_network_status( monitor, REGISTRATION_GPRS );
962- break;
963- case 2:
964- /* Check for HSDPA/UMTS */
965- cellmodem_t_get_ohcip_status( monitor );
966- return;
967- default:
968- cellmodem_t_switch_network_status( monitor, REGISTRATION_UNKNOWN );
969- }
970- }
971- } else {
972- cellmodem_t_switch_network_status( monitor, REGISTRATION_NOT_REGISTERED );
973-
974- cellmodem_t_switch_to_error_and_restart( monitor, _("Invalid COPS reply from modem") );
975- return;
976- }
977-
978- cellmodem_t_get_quality( monitor );
979-}
980-
981-/**
982- * @brief [cellmodem_t pseudo-member] Callback for PIN status request
983- *
984- * @param success TRUE if modem replied OK, FALSE otherwise
985- * @param response GString with modem response
986- * @param pvt Pointer to cellmodem object
987- *
988- * pvt will be deferenced to cellmodem object upon calling. No typechecking is done.
989- *
990- * @return Nothing
991- */
992-
993-static void
994-cellmodem_t_pin_callback(gboolean success, GString *response, void *pvt)
995-{
996- cellmodem_t *monitor = (cellmodem_t*)pvt;
997- gboolean failure = FALSE;
998-
999- if ( !success || response==NULL || response->str==NULL ) {
1000- /* Error */
1001- DEBUG("Modem error detected (%p)", pvt);
1002- cellmodem_t_switch_to_error_and_restart( monitor, _("Error in modem reply to CPIN") );
1003- return;
1004- }
1005-
1006- /* +CPIN: SIM PIN */
1007- /* +CPIN: READY */
1008-
1009- if ( strncmp(response->str,"+CPIN: ", 7 )==0 ) {
1010- gchar *start = response->str + 7;
1011- DEBUG("CPIN: '%s'", start);
1012- if ( strncmp( start, "SIM PIN", 7) == 0) {
1013- /* If we can ask for pin, we do */
1014-
1015- cellmodem_t_request_pin( monitor );
1016- return;
1017- }
1018- if ( strncmp( start, "READY", 2) == 0 )
1019- {
1020- /* If we got here, we are registering. Do nothing, just
1021- reschedule open */
1022- } else {
1023- failure = TRUE;
1024- }
1025-
1026- /* Errors found ?? . */
1027- } else {
1028- cellmodem_t_switch_to_error_and_restart( monitor, _("Invalid CPIN reply from modem") );
1029-
1030- reschedule_open( monitor );
1031- }
1032- if ( failure )
1033- cellmodem_t_switch_to_error_and_restart( monitor, _("Unsupportted CPIN reply from modem") );
1034- else
1035- reschedule_open( monitor );
1036-}
1037-
1038-/**
1039- * @brief [cellmodem_t pseudo-member] Callback for OHCIP status request
1040- *
1041- * @param success TRUE. We ignore OHCIP errors, not all modem support it
1042- * @param response GString with modem response
1043- * @param pvt Pointer to cellmodem object
1044- *
1045- * pvt will be deferenced to cellmodem object upon calling. No typechecking is done.
1046- *
1047- * @return Nothing
1048- */
1049-
1050-static void
1051-cellmodem_t_ohcip_callback(gboolean success, GString *response, void *pvt)
1052-{
1053- cellmodem_t *monitor = (cellmodem_t*)pvt;
1054- gboolean failure = FALSE;
1055-
1056- if ( !success || response==NULL || response->str==NULL ) {
1057- /* Error - ignore */
1058- cellmodem_t_switch_network_status( monitor, REGISTRATION_UMTS );
1059- goto ohcip_out;
1060- }
1061-
1062- /* +CPIN: SIM PIN */
1063- /* +CPIN: READY */
1064-
1065- if ( strncmp(response->str,"_OHCIP: ", 8 )==0 ) {
1066- gchar *start = response->str + 8;
1067- DEBUG("OHCIP: '%s'", start);
1068- if ( strncmp( start, "1", 1) == 0) {
1069-
1070- cellmodem_t_switch_network_status( monitor, REGISTRATION_HSDPA );
1071- } else {
1072- cellmodem_t_switch_network_status( monitor, REGISTRATION_UMTS );
1073- }
1074-
1075- /* Errors found ?? . */
1076- } else {
1077- cellmodem_t_switch_to_error_and_restart( monitor, _("Invalid OHCIP reply from modem") );
1078-
1079- reschedule_open( monitor );
1080- }
1081- if ( failure )
1082- cellmodem_t_switch_to_error_and_restart( monitor, _("Unsupportted OHCIP reply from modem") );
1083-ohcip_out:
1084- cellmodem_t_get_quality( monitor );
1085-}
1086-
1087-
1088-static void
1089-cellmodem_t_setpin_callback(gboolean success, GString *response, void *pvt)
1090-{
1091- cellmodem_t *monitor = (cellmodem_t*)pvt;
1092-
1093- if ( !success ) {
1094- /* Error */
1095- cellmodem_t_switch_to_error_and_restart( monitor, _("Cannot send PIN to modem") );
1096- return;
1097- }
1098-
1099- /* TODO: We should recheck if PIN was accepted */
1100-
1101-
1102-
1103- /* Just try to reopen. */
1104-
1105- cellmodem_t_switch_status( monitor, MODEM_CLOSED );
1106-
1107- reschedule_open( monitor /*, FALSE*/ );
1108-}
1109-
1110-
1111-/**
1112- * @brief [cellmodem_t pseudo-member] Callback for quality request
1113- *
1114- * @param success TRUE if modem replied OK, FALSE otherwise
1115- * @param response GString with modem response
1116- * @param pvt Pointer to cellmodem object
1117- *
1118- * pvt will be deferenced to cellmodem object upon calling. No typechecking is done.
1119- *
1120- * @return Nothing
1121- */
1122-
1123-static void
1124-cellmodem_t_quality_callback(gboolean success, GString *response, void *pvt)
1125-{
1126- cellmodem_t *monitor = (cellmodem_t*)pvt;
1127-
1128- if ( !success || response==NULL || response->str==NULL ) {
1129- /* Error */
1130- DEBUG("Modem error detected (%p)", pvt);
1131- cellmodem_t_switch_to_error_and_restart( monitor, _("Error in modem reply to CSQ") );
1132- return;
1133- }
1134-
1135- if ( strncmp( response->str ,"+CSQ: ", 6 )==0 ) {
1136- gchar *start = response->str + 6;
1137- if ( strtok( start, ",") == NULL) {
1138- return;/* FALSE;*/
1139- }
1140- strtok ( NULL, "," );
1141- DEBUG("Qual: '%s'\n", start );
1142-
1143- int i = atoi( start );
1144- monitor->signal_strength = i;
1145- monitor->quality = (double)i/ (double)monitor->options.max_quality;
1146- if (monitor->quality>1.0)
1147- monitor->quality=1.0;
1148-
1149- cellmodem_t_update_monitors( monitor );
1150- } else {
1151- cellmodem_t_switch_to_error_and_restart( monitor, _("Invalid CSQ reply from modem") );
1152- return;
1153- }
1154- DEBUG("Got quality, restarting");
1155- /* cellmodem_t_close_modem( monitor, FALSE ); - reschedule will close */
1156- cellmodem_t_switch_status( monitor, MODEM_CLOSED );
1157- reschedule_open( monitor /*, FALSE*/ );
1158-}
1159-
1160-/**
1161- * @brief [cellmodem_t member] Request registration status from modem
1162- *
1163- * @param monitor The cellmodem object
1164- *
1165- * This is asynchronous. Pseudo-method "cellmodem_t_registration_callback" will
1166- * be called when modem replies.
1167- *
1168- * @return Nothing
1169- */
1170-
1171-static void
1172-cellmodem_t_is_registered( cellmodem_t *monitor )
1173-{
1174- cellmodem_t_send_at_command(monitor, &cellmodem_t_registration_callback, "+CREG?" );
1175- cellmodem_t_switch_status( monitor, MODEM_WAIT_CREG_RESPONSE );
1176-}
1177-
1178-/**
1179- * @brief [cellmodem_t member] Request network id from modem
1180- *
1181- * @param monitor The cellmodem object
1182- *
1183- * This is asynchronous. Pseudo-method "cellmodem_t_identify_callback" will
1184- * be called when modem replies.
1185- *
1186- * This should only be called when we are sure we are registered to some
1187- * network, by using "cellmodem_t_is_registered".
1188- *
1189- * @return Nothing
1190- */
1191-
1192-static void
1193-cellmodem_t_identify_network( cellmodem_t *monitor )
1194-{
1195- cellmodem_t_send_at_command(monitor, &cellmodem_t_identify_callback, "+COPS?" );
1196- cellmodem_t_switch_status( monitor, MODEM_WAIT_COPS_RESPONSE );
1197-
1198-}
1199-
1200-/**
1201- * @brief [cellmodem_t member] Request signal quality from modem
1202- *
1203- * @param monitor The cellmodem object
1204- *
1205- * This is asynchronous. Pseudo-method "cellmodem_t_quality_callback" will
1206- * be called when modem replies.
1207- *
1208- * This should only be called when we are sure we are registered to some
1209- * network.
1210- *
1211- * @return Nothing
1212- */
1213-
1214-static void
1215-cellmodem_t_get_quality( cellmodem_t *monitor )
1216-{
1217- cellmodem_t_send_at_command(monitor, &cellmodem_t_quality_callback, "+CSQ" );
1218- cellmodem_t_switch_status( monitor, MODEM_WAIT_CSQ_RESPONSE );
1219-}
1220-
1221-/**
1222- * @brief [cellmodem_t member] Request PIN status from modem
1223- *
1224- * @param monitor The cellmodem object
1225- *
1226- * This is asynchronous. Pseudo-method "cellmodem_t_pin_callback" will
1227- * be called when modem replies.
1228- *
1229- * This should only be called when we are sure we are NOT registered to some
1230- * network.
1231- *
1232- * @return Nothing
1233- */
1234-
1235-static void
1236-cellmodem_t_get_pin_status( cellmodem_t *monitor )
1237-{
1238- cellmodem_t_send_at_command(monitor, &cellmodem_t_pin_callback, "+CPIN?" );
1239- cellmodem_t_switch_status( monitor, MODEM_WAIT_CPIN_RESPONSE );
1240-
1241-}
1242-
1243-/**
1244- * @brief [cellmodem_t member] Request HSDPA Call-In-Progress status from modem
1245- *
1246- * @param monitor The cellmodem object
1247- *
1248- * This is asynchronous. Pseudo-method "cellmodem_t_ohcip_callback" will
1249- * be called when modem replies.
1250- *
1251- * @return Nothing
1252- */
1253-
1254-static void
1255-cellmodem_t_get_ohcip_status( cellmodem_t *monitor )
1256-{
1257- cellmodem_t_send_at_command(monitor, &cellmodem_t_ohcip_callback, "_OHCIP?" );
1258- cellmodem_t_switch_status( monitor, MODEM_WAIT_OHCIP_RESPONSE );
1259-}
1260-
1261-
1262-static void
1263-cellmodem_t_send_pin( cellmodem_t *monitor, const gchar *pin )
1264-{
1265- GString *g = g_string_new("+CPIN=");
1266- g_string_append( g, pin );
1267-
1268- if (cellmodem_t_open_modem( monitor ) == TRUE) {
1269-
1270- cellmodem_t_send_at_command(monitor, &cellmodem_t_setpin_callback, g->str );
1271- g_string_free( g, TRUE );
1272-
1273- cellmodem_t_switch_status( monitor, MODEM_WAIT_PINE_RESPONSE );
1274- } else {
1275- cellmodem_t_switch_to_error_and_restart( monitor, _("Cannot open modem") );
1276- }
1277-}
1278-
1279-
1280-/**
1281- * @brief [cellmodem_t member] Handle modem response
1282- *
1283- * This method will dispatch the appropriate pseudo-member callback. The reply
1284- * MUST be a single line replied from the modem. Call this function for each
1285- * line you receive from modem.
1286- *
1287- * @param monitor The cellmodem object
1288- * @param buffer The reply from modem
1289- *
1290- * @return TRUE [TBD when FALSE]
1291- */
1292-
1293-static gboolean
1294-cellmodem_t_modem_handle_response( cellmodem_t *monitor, char *buffer )
1295-{
1296- char *bstart;
1297- DEBUG("In handle response");
1298-
1299- if ( monitor->resp.reply_callback == NULL ) {
1300- DEBUG("No callback defined!!!!");
1301- return TRUE; /* No registered listener. */
1302- }
1303- if ( monitor->resp.reply_buffer == NULL )
1304- {
1305- monitor->resp.reply_buffer = g_string_new( NULL ); /* Initialize to NULL */
1306- }
1307-
1308- /* Remove trailing \r and \n */
1309-
1310- bstart = remove_leading_chars(buffer,"\n\r");
1311- remove_trailing_chars(bstart,"\r\n");
1312-
1313- /* See if it is echo */
1314-
1315- if ( strcmp( monitor->lastcmd , bstart ) == 0 ) {
1316- DEBUG("Echo detected, skipping");
1317- return TRUE;
1318- }
1319-
1320- /* Ignore empty lines */
1321-
1322- if ( is_only_spaces( bstart ) ) {
1323- DEBUG("Only spaces found in reply, skipping");
1324- return TRUE;
1325- }
1326-
1327- DEBUG("Got response: '%s' command '%s'\n", bstart, monitor->lastcmd);
1328-
1329- cellmodem_t_cancel_pending_at_command_timeout( monitor );
1330-
1331- if ( is_AT_error_reply( bstart ) ) {
1332-
1333- monitor->resp.reply_callback( FALSE,
1334- monitor->resp.reply_buffer,
1335- monitor->resp.reply_pvt );
1336- DEBUG("Free reply data");
1337-
1338- g_string_free( monitor->resp.reply_buffer, TRUE );
1339- monitor->resp.reply_buffer = NULL;
1340-
1341- DEBUG("Done handling error");
1342- return TRUE;
1343- }
1344-
1345- if ( is_AT_success_reply( bstart ) ) {
1346- DEBUG("Got AT OK reply");
1347- monitor->resp.reply_callback( TRUE,
1348- monitor->resp.reply_buffer,
1349- monitor->resp.reply_pvt );
1350-
1351- g_string_free( monitor->resp.reply_buffer, TRUE );
1352- monitor->resp.reply_buffer = NULL;
1353-
1354- return TRUE;
1355- }
1356-
1357- g_string_append( monitor->resp.reply_buffer, bstart );
1358- g_string_append( monitor->resp.reply_buffer, "\n" );
1359-
1360- DEBUG("Finished handling");
1361- return TRUE;
1362-}
1363-
1364-
1365-/**
1366- * @brief [cellmodem_t pseudo-member] Handle modem response direcly from the driver
1367- *
1368- * The driver will call this pseudo-method when data arrives at the
1369- * modem channel.
1370- *
1371- * @param chan The modem channel
1372- * @param c The IO condition ( G_IO_IN )
1373- * @param data The cellmodem object
1374- *
1375- * 'data' will be deferenced to cellmodem object. No typechecking is done.
1376- *
1377- * The reply from modem are handled by the appropriate method set up when
1378- * "cellmodem_t_send_at_command" was called.
1379- *
1380- * @return TRUE if correctly handled, FALSE if not.
1381- *
1382- */
1383-
1384-
1385-static gboolean
1386-cellmodem_t_modem_callback(GIOChannel *chan, GIOCondition c, gpointer data )
1387-{
1388- cellmodem_t *monitor = (cellmodem_t*)data;
1389- /* Data ready */
1390- DEBUG("Data from modem ready, IO cond %d, data %p", c, data);
1391- gsize length;
1392- GError *error = NULL;
1393- GIOStatus status;
1394- gboolean r;
1395-
1396- if ( chan == NULL )
1397- {
1398- DEBUG("NULL channel!!!");
1399- return FALSE;
1400- }
1401-
1402- DEBUG("Line buffer size before reading: %d", monitor->line_buffer_size);
1403-
1404-
1405- status = g_io_channel_read_chars(
1406- chan,
1407- monitor->line_buffer + (monitor->line_buffer_size),
1408- 8192-(monitor->line_buffer_size),
1409- &length,
1410- &error
1411- );
1412- if ( status == G_IO_STATUS_AGAIN ) {
1413- usleep(10000);
1414- return TRUE;
1415- }
1416-
1417- if (status != G_IO_STATUS_NORMAL ) {
1418- DEBUG("Error reading from modem");
1419- cellmodem_t_switch_to_error( monitor, _("Error reading from modem") );
1420- cellmodem_t_close_modem( monitor /*, TRUE*/ );
1421- return FALSE;
1422- }
1423-
1424-
1425- monitor->line_buffer_size+=length;
1426- monitor->line_buffer[ monitor->line_buffer_size ] = 0;
1427-
1428- DEBUG("Read %d bytes from modem: '%s'", length, monitor->line_buffer);
1429- DEBUG("Buffer size now %d", monitor->line_buffer_size );
1430- char *eol;
1431- do {
1432- eol = memchr( monitor->line_buffer, '\n', monitor->line_buffer_size);
1433- DEBUG("EOL: from %p -> %p",monitor->line_buffer, eol);
1434- if ( eol!=NULL ) {
1435- DEBUG("Handling command from modem");
1436- size_t dist = eol-monitor->line_buffer;
1437- gchar * line = g_strndup( monitor->line_buffer, dist+1 );
1438- line[dist+1]=0;
1439- memmove(monitor->line_buffer, eol+1, (monitor->line_buffer_size)-dist-1 );
1440- monitor->line_buffer_size-=dist+1;
1441- DEBUG("Calling handle response");
1442- r = cellmodem_t_modem_handle_response( monitor, line );
1443- g_free( line );
1444- if (!r)
1445- return r;
1446- } else {
1447- DEBUG("No newline in modem reply, waiting");
1448- }
1449- } while (eol);
1450- return TRUE;
1451-}
1452-
1453-/**
1454- * @brief [cellmodem_t member] Send an AT (ATtention) command to modem
1455- *
1456- * @param monitor The cellmodem object
1457- * @param callback The callback which is to be called when modem replies.
1458- * @param command The AT command (without the 'AT' prefix and without CR/LF)
1459- *
1460- * This will call the modem driver to send the command to the modem. The pvt
1461- * field will be set to the cellmodem object.
1462- *
1463- * @return TRUE if correctly sent, FALSE if not.
1464- *
1465- */
1466-
1467-static gboolean
1468-cellmodem_t_send_at_command( cellmodem_t *monitor,
1469- modem_reply_callback_t callback,
1470- const gchar *command )
1471-{
1472-
1473- monitor->resp.reply_callback = callback;
1474- monitor->resp.reply_pvt = monitor;
1475-
1476- DEBUG("Callback set to %p", callback );
1477-
1478- snprintf(monitor->lastcmd, 128, "AT%s", command );
1479-
1480- /* TODO - check if we already have a timeout */
1481-
1482- if ( monitor->at_timeout_id > 0 )
1483- g_source_remove( monitor->at_timeout_id );
1484-
1485- monitor->at_timeout_id =
1486- g_timeout_add( 1000,
1487- (GSourceFunc) cellmodem_t_at_command_timeout,
1488- monitor );
1489-
1490- if ( monitor->driver->writeln(
1491- monitor->modem_instance,
1492- monitor->lastcmd
1493- ) == FALSE )
1494- {
1495- DEBUG("ERROR Command: '%s'\n", monitor->lastcmd );
1496- cellmodem_t_switch_to_error( monitor, _("Error writing to modem") );
1497- cellmodem_t_close_modem( monitor /*, TRUE*/ );
1498- return FALSE;
1499- }
1500-
1501- DEBUG("Sent command to modem: '%s'\n", monitor->lastcmd);
1502-
1503- return TRUE;
1504-}
1505-
1506-
1507-static gboolean
1508-cellmodem_t_at_command_timeout( cellmodem_t *monitor )
1509-{
1510- monitor->at_timeout_id = -1;
1511- DEBUG("Modem failed to reply");
1512- cellmodem_t_switch_to_error_and_restart( monitor, _("Modem did not reply to command") );
1513- return FALSE;
1514-}
1515-
1516-static void
1517-cellmodem_t_cancel_pending_at_command_timeout( cellmodem_t *monitor )
1518-{
1519- if (monitor->at_timeout_id > 0) {
1520- g_source_remove ( monitor->at_timeout_id );
1521- }
1522- monitor->at_timeout_id = -1;
1523-}
1524-
1525-
1526-static gboolean
1527-cellmodem_t_open_modem(cellmodem_t *monitor)
1528-{
1529- if ( NULL == monitor->driver ) {
1530- cellmodem_t_switch_to_error( monitor, _("No driver defined") );
1531- return FALSE;
1532- }
1533-
1534- if ( NULL == monitor->modem_instance ) {
1535- cellmodem_t_switch_to_error( monitor, _("No modem instance") );
1536- return FALSE;
1537- }
1538-
1539- if ( monitor->driver->open( monitor->modem_instance,
1540- &monitor->options ) == FALSE )
1541- {
1542- return FALSE;
1543- }
1544- /* cellmodem_t_switch_status( monitor, MODEM_IDLE ); */
1545- cellmodem_t_reset_buffer( monitor );
1546-
1547- monitor->driver->set_reader( monitor->modem_instance,
1548- cellmodem_t_modem_callback,
1549- monitor);
1550-
1551- return TRUE;
1552-}
1553-
1554-
1555-static gboolean
1556-reschedule_open( cellmodem_t *monitor /*, gboolean failure*/ )
1557-{
1558- DEBUG("RESCHEDULING OPEN");
1559- cellmodem_t_close_modem( monitor /*, failure*/ );
1560-
1561- if ( monitor->info_timeout_id > 0 )
1562- {
1563- g_source_remove( monitor->info_timeout_id );
1564- }
1565-
1566- monitor->info_timeout_id = g_timeout_add( OPEN_TIMEOUT,
1567- (GSourceFunc) get_network_info ,
1568- monitor );
1569-
1570- return FALSE; /* Cancel this timer */
1571-}
1572-
1573-
1574-/**
1575- * This will be called from a timer (but at startup)
1576- */
1577-
1578-static gboolean
1579-get_network_info( cellmodem_t *monitor )
1580-{
1581- DEBUG("Getting network info");
1582- if ( cellmodem_t_open_modem( monitor ) != FALSE ) {
1583-
1584- cellmodem_t_is_registered( monitor );
1585- return FALSE; /* Dont restart timer. */
1586- }
1587- DEBUG("Cannot open modem");
1588-
1589- cellmodem_t_switch_to_error_and_restart( monitor, _("Cannot open modem") );
1590-
1591- return FALSE;
1592-}
1593-
1594-
1595-/*
1596- Configuration stuff
1597- */
1598-
1599-static void
1600-cellmodem_read_config(XfcePanelPlugin *plugin, cellmodem_t *monitor)
1601-{
1602- char *file;
1603- const char *text;
1604- XfceRc *rc;
1605-
1606- if (!(file = xfce_panel_plugin_lookup_rc_file (plugin))) {
1607- DEBUG("No config file found\n");
1608- return;
1609- }
1610-
1611- rc = xfce_rc_simple_open (file, TRUE);
1612- g_free (file);
1613-
1614- if (!rc) {
1615- DEBUG("Cannot open config file\n");
1616-
1617- return;
1618- }
1619-
1620- monitor->options.display_tooltip_info =
1621- xfce_rc_read_bool_entry (rc, "display_tooltip_info", FALSE);
1622-
1623-
1624- if ( NULL != monitor->options.modem_device )
1625- g_free( monitor->options.modem_device );
1626-
1627- text = xfce_rc_read_entry (rc, "modem_device", NULL);
1628- if (NULL!=text && *text) {
1629- monitor->options.modem_device = g_strdup (text);
1630- } else {
1631-
1632- monitor->options.modem_device = NULL;
1633- }
1634-
1635- if ( NULL != monitor->options.modem_driver )
1636- g_free( monitor->options.modem_driver );
1637-
1638- text = xfce_rc_read_entry (rc, "modem_driver", NULL);
1639- if (NULL!=text && *text) {
1640- monitor->options.modem_driver = g_strdup (text);
1641- } else {
1642- monitor->options.modem_driver = NULL;
1643- }
1644-
1645-
1646- monitor->options.low_threshold = xfce_rc_read_int_entry( rc, "low_threshold", 40 );
1647- monitor->options.critical_threshold = xfce_rc_read_int_entry( rc, "critical_threshold", 20 );
1648- monitor->options.max_quality = xfce_rc_read_int_entry( rc, "max_quality", MAX_QUAL );
1649-
1650-
1651- xfce_rc_close (rc);
1652-
1653-}
1654-
1655-
1656-void
1657-cellmodem_write_config(XfcePanelPlugin *plugin, cellmodem_t *monitor)
1658-{
1659- XfceRc *rc;
1660- char *file;
1661-
1662- DEBUG("Saving configuration");
1663-
1664- if (!(file = xfce_panel_plugin_save_location (plugin, TRUE))) {
1665- DEBUG("Cannot save configuration!");
1666- return;
1667- }
1668-
1669- rc = xfce_rc_simple_open (file, FALSE);
1670- g_free (file);
1671-
1672-
1673- if (!rc) {
1674- DEBUG("Cannot open configuration file to save!");
1675- return;
1676- }
1677-
1678- xfce_rc_write_bool_entry (rc, "display_tooltip_info",
1679- monitor->options.display_tooltip_info);
1680-
1681- xfce_rc_write_entry (rc, "modem_device",
1682- monitor->options.modem_device );
1683- xfce_rc_write_entry (rc, "modem_driver",
1684- monitor->options.modem_driver );
1685-
1686- xfce_rc_write_int_entry( rc, "low_threshold", monitor->options.low_threshold );
1687- xfce_rc_write_int_entry( rc, "critical_threshold", monitor->options.critical_threshold );
1688- xfce_rc_write_int_entry( rc, "max_quality", monitor->options.max_quality );
1689-
1690- DEBUG("Done saving configuration");
1691- xfce_rc_close (rc);
1692-}
1693-
1694-
1695-void
1696-cellmodem_t_initialize_modem( cellmodem_t *monitor )
1697-{
1698- DEBUG(" ---- Initializing modem ---- ");
1699-
1700- cellmodem_t_switch_to_error( monitor, _("Modem initializing") );
1701-
1702- /*
1703- Cancel any pending timers
1704- */
1705-
1706- if (monitor->at_timeout_id > 0) {
1707- g_source_remove( monitor->at_timeout_id );
1708- }
1709- if ( monitor->info_timeout_id > 0 )
1710- {
1711- g_source_remove( monitor->info_timeout_id );
1712- }
1713-
1714- if ( monitor->options.modem_driver == NULL ) {
1715- DEBUG("No driver defined, skipping");
1716- return;
1717- }
1718-
1719- /* TODO: Skip if we already have this driver loaded */
1720-
1721- if ( monitor->driver != NULL && monitor->modem_instance != NULL ) {
1722- DEBUG("Closing already created driver/instance");
1723- monitor->driver->close( monitor->modem_instance );
1724- DEBUG("Destroying the modem instance");
1725- monitor->driver->destroy( monitor->modem_instance );
1726- monitor->modem_instance = NULL;
1727- }
1728-
1729- monitor->driver = NULL;
1730- DEBUG("Locating driver");
1731- monitor->driver = find_driver_by_name( monitor->options.modem_driver );
1732-
1733- if (monitor->driver==NULL) {
1734- DEBUG("Cannot find that driver (%s)!!!", monitor->options.modem_driver);
1735- cellmodem_t_switch_to_error( monitor, _("Invalid driver specified") );
1736- return;
1737- }
1738-
1739- DEBUG("Modem driver at %p", monitor->driver);
1740- monitor->modem_instance =
1741- monitor->driver->create();
1742-
1743- DEBUG("Modem instance created");
1744-
1745- cellmodem_t_switch_status( monitor, MODEM_WAIT_CREG_RESPONSE );
1746-
1747- DEBUG("Calling get network info");
1748-
1749- get_network_info(monitor);
1750-
1751-}
1752-
1753-static gboolean
1754-cellmodem_button_event(GtkEventBox *box, GdkEventButton *button, cellmodem_t *monitor)
1755-{
1756- if (button->type != GDK_BUTTON_PRESS || button->button != 1) {
1757- return FALSE;
1758- }
1759-
1760- if ( monitor->registration_status == REGISTRATION_NEEDS_PIN )
1761- {
1762- pin_helper_launch( GTK_WIDGET(monitor->plugin), pin_callback, monitor );
1763- }
1764- return TRUE;
1765-}
1766-
1767-
1768-#ifdef DEBUG_ENABLED
1769-
1770-int init_logging()
1771-{
1772- openlog("cellmodem", LOG_PID, LOG_USER );
1773-
1774- return 0;
1775-}
1776-
1777-char logbuf[8192];
1778-
1779-#endif
1780-/* create the plugin */
1781-
1782-static void
1783-cellmodem_t_construct (XfcePanelPlugin *plugin)
1784-{
1785- cellmodem_t *monitor;
1786-
1787- xfce_textdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
1788-
1789-#ifdef DEBUG_ENABLED
1790- init_logging();
1791-#endif
1792-
1793- DEBUG("Creating applet\n");
1794- monitor = cellmodem_t_new (plugin);
1795-
1796- DEBUG("Reading config\n");
1797- cellmodem_read_config (plugin, monitor);
1798- cellmodem_t_initialize_modem( monitor );
1799-
1800- cellmodem_t_update_monitors( monitor );
1801-
1802- g_signal_connect (plugin, "free-data", G_CALLBACK (cellmodem_t_delete), monitor);
1803- g_signal_connect (plugin, "save", G_CALLBACK (cellmodem_write_config), monitor);
1804- g_signal_connect (plugin, "size-changed", G_CALLBACK (cellmodem_set_size), monitor);
1805-
1806- xfce_panel_plugin_menu_show_configure (plugin);
1807-
1808- g_signal_connect (plugin, "configure-plugin", G_CALLBACK (cellmodem_create_options), monitor);
1809-
1810- gtk_container_add(GTK_CONTAINER(plugin), monitor->eventbox);
1811-
1812-}
1813-
1814-XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL (cellmodem_t_construct);
1815
1816=== removed file '.pc/applied-patches'
1817--- .pc/applied-patches 2012-05-17 20:09:01 +0000
1818+++ .pc/applied-patches 1970-01-01 00:00:00 +0000
1819@@ -1,3 +0,0 @@
1820-01_typo-linking.patch
1821-02_explicit-linking-to-libxfcegui4.patch
1822-03_fix-crash-on-remove.patch
1823
1824=== modified file 'configure.ac'
1825--- configure.ac 2011-06-27 22:39:05 +0000
1826+++ configure.ac 2013-12-17 04:49:05 +0000
1827@@ -18,8 +18,6 @@
1828 AC_CHECK_FUNCS([vasprintf])
1829
1830 XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.3.20])
1831-XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.3.20])
1832-
1833 XDT_I18N([cs pt])
1834
1835 AC_ARG_ENABLE([debug],
1836
1837=== modified file 'debian/changelog'
1838--- debian/changelog 2012-05-18 22:36:10 +0000
1839+++ debian/changelog 2013-12-17 04:49:05 +0000
1840@@ -1,3 +1,45 @@
1841+xfce4-cellmodem-plugin (0.0.5.dfsg-5ubuntu1) trusty; urgency=medium
1842+
1843+ * Merge from debian. Remaining changes:
1844+ - Use different orig tarball and versioning
1845+
1846+ -- Jackson Doak <noskcaj@ubuntu.com> Tue, 17 Dec 2013 08:28:10 +1100
1847+
1848+xfce4-cellmodem-plugin (0.0.5-5) unstable; urgency=low
1849+
1850+ [ Lionel Le Folgoc ]
1851+ * Port from libxfcegui4 to libxfce4ui:
1852+ - debian/patches/05_port-to-libxfce4ui.patch: added.
1853+ - debian/control: replace libxfcegui4-dev build-dep with libxfce4ui-1-dev.
1854+
1855+ [ Evgeni Golov ]
1856+ * Correct Vcs-* URLs to point to anonscm.debian.org
1857+
1858+ [ Yves-Alexis Perez ]
1859+ * debian/rules:
1860+ - enable parallel build.
1861+ * debian/control:
1862+ - update standards version to 3.9.4.
1863+
1864+ -- Lionel Le Folgoc <mrpouit@gmail.com> Wed, 09 Oct 2013 22:09:20 +0200
1865+
1866+xfce4-cellmodem-plugin (0.0.5.dfsg-4ubuntu1) saucy; urgency=low
1867+
1868+ * Resync with Debian testing (different orig tarball and versioning).
1869+
1870+ -- Jackson Doak <noskcaj@ubuntu.com> Wed, 28 Aug 2013 07:05:02 +1000
1871+
1872+xfce4-cellmodem-plugin (0.0.5-4) unstable; urgency=low
1873+
1874+ * debian/rules:
1875+ - enable all hardening flags.
1876+ * debian/control:
1877+ - update standards version to 3.9.3.
1878+ - remove dpkg-dev versionned build-dep, dpkg is recent enough in stable.
1879+ - remove version on xfce4-panel-dev dependency.
1880+
1881+ -- Yves-Alexis Perez <corsac@debian.org> Thu, 23 May 2013 07:52:49 +0200
1882+
1883 xfce4-cellmodem-plugin (0.0.5.dfsg-3ubuntu2) quantal; urgency=low
1884
1885 * No change rebuild against xfce4-panel 4.10.
1886
1887=== modified file 'debian/control'
1888--- debian/control 2012-05-17 20:09:01 +0000
1889+++ debian/control 2013-12-17 04:49:05 +0000
1890@@ -6,12 +6,12 @@
1891 Uploaders: Evgeni Golov <evgeni@debian.org>,
1892 Yves-Alexis Perez <corsac@debian.org>, Lionel Le Folgoc <mrpouit@gmail.com>
1893 Build-Depends: debhelper (>= 9), autotools-dev, libpci-dev, libusb-dev,
1894- libxml-parser-perl, pkg-config, xfce4-panel-dev (>= 4.8), libxfcegui4-dev,
1895- intltool, automake, autoconf, xfce4-dev-tools, dpkg (>= 1.16.1)
1896-Standards-Version: 3.9.2
1897+ libxml-parser-perl, pkg-config, xfce4-panel-dev, libxfce4ui-1-dev,
1898+ intltool, automake, autoconf, xfce4-dev-tools
1899+Standards-Version: 3.9.4
1900 Homepage: http://goodies.xfce.org/projects/panel-plugins/xfce4-cellmodem-plugin
1901-Vcs-Svn: svn://svn.debian.org/svn/pkg-xfce/goodies/trunk/xfce4-cellmodem-plugin/
1902-Vcs-Browser: http://svn.debian.org/wsvn/pkg-xfce/goodies/trunk/xfce4-cellmodem-plugin/
1903+Vcs-Svn: svn://anonscm.debian.org/pkg-xfce/goodies/trunk/xfce4-cellmodem-plugin/
1904+Vcs-Browser: http://anonscm.debian.org/viewvc/pkg-xfce/goodies/trunk/xfce4-cellmodem-plugin/
1905
1906 Package: xfce4-cellmodem-plugin
1907 Architecture: any
1908
1909=== added file 'debian/patches/04_port-to-libxfce4ui.patch'
1910--- debian/patches/04_port-to-libxfce4ui.patch 1970-01-01 00:00:00 +0000
1911+++ debian/patches/04_port-to-libxfce4ui.patch 2013-12-17 04:49:05 +0000
1912@@ -0,0 +1,94 @@
1913+Description: port from libxfcegui4 to libxfce4ui
1914+Origin: vendor, http://cvs.pld-linux.org/cgi-bin/viewvc.cgi/cvs/packages/xfce4-cellmodem-plugin/xfce4-cellmodem-plugin-ui.patch?view=markup
1915+
1916+diff -ur xfce4-cellmodem-plugin-0.0.5-orig/configure.ac xfce4-cellmodem-plugin-0.0.5/configure.ac
1917+--- xfce4-cellmodem-plugin-0.0.5-orig/configure.ac 2011-03-01 11:20:17.671067640 +0100
1918++++ xfce4-cellmodem-plugin-0.0.5/configure.ac 2011-03-01 12:18:30.190889236 +0100
1919+@@ -18,7 +18,7 @@
1920+ AC_CHECK_FUNCS([vasprintf])
1921+
1922+ XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.3.20])
1923+-XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.3.20])
1924++XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.8.0])
1925+
1926+ XDT_I18N([cs pt])
1927+
1928+diff -ur xfce4-cellmodem-plugin-0.0.5-orig/panel-plugin/cellmodem.h xfce4-cellmodem-plugin-0.0.5/panel-plugin/cellmodem.h
1929+--- xfce4-cellmodem-plugin-0.0.5-orig/panel-plugin/cellmodem.h 2006-10-30 20:27:24.000000000 +0100
1930++++ xfce4-cellmodem-plugin-0.0.5/panel-plugin/cellmodem.h 2011-03-01 12:18:30.191889236 +0100
1931+@@ -33,8 +33,8 @@
1932+ #include <gtk/gtk.h>
1933+ #include <glib.h>
1934+ #include <libxfce4util/libxfce4util.h>
1935+-#include <libxfcegui4/libxfcegui4.h>
1936+-#include <libxfce4panel/xfce-panel-plugin.h>
1937++#include <libxfce4ui/libxfce4ui.h>
1938++#include <libxfce4panel/libxfce4panel.h>
1939+ #include "leds.h"
1940+
1941+ #ifdef DEBUG_ENABLED
1942+diff -ur xfce4-cellmodem-plugin-0.0.5-orig/panel-plugin/Makefile.am xfce4-cellmodem-plugin-0.0.5/panel-plugin/Makefile.am
1943+--- xfce4-cellmodem-plugin-0.0.5-orig/panel-plugin/Makefile.am 2011-03-01 11:20:17.671067640 +0100
1944++++ xfce4-cellmodem-plugin-0.0.5/panel-plugin/Makefile.am 2011-03-01 12:18:30.194889236 +0100
1945+@@ -4,11 +4,11 @@
1946+ xfce4_cellmodem_plugin_CFLAGS = \
1947+ -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
1948+ @LIBXFCE4PANEL_CFLAGS@ \
1949+- @LIBXFCEGUI4_CFLAGS@
1950++ @LIBXFCE4UI_CFLAGS@
1951+
1952+ xfce4_cellmodem_plugin_LDADD = \
1953+ @LIBXFCE4PANEL_LIBS@ \
1954+- @LIBXFCEGUI4_LIBS@
1955++ @LIBXFCE4UI_LIBS@
1956+
1957+ xfce4_cellmodem_plugin_SOURCES = \
1958+ cellmodem.c modem_driver.c \
1959+diff -ur xfce4-cellmodem-plugin-0.0.5-orig/panel-plugin/pin_helper.c xfce4-cellmodem-plugin-0.0.5/panel-plugin/pin_helper.c
1960+--- xfce4-cellmodem-plugin-0.0.5-orig/panel-plugin/pin_helper.c 2006-10-05 13:47:16.000000000 +0200
1961++++ xfce4-cellmodem-plugin-0.0.5/panel-plugin/pin_helper.c 2011-03-01 12:19:26.308889237 +0100
1962+@@ -28,7 +28,7 @@
1963+ if (!pin || strlen(pin)!=4 )
1964+ {
1965+ /* Error. */
1966+- xfce_warn(_("Invalid PIN entered. PIN has 4 digits"));
1967++ xfce_dialog_show_warning(NULL, NULL, _("Invalid PIN entered. PIN has 4 digits"));
1968+
1969+ return;
1970+ }
1971+diff -ur xfce4-cellmodem-plugin-0.0.5-orig/panel-plugin/preferences.c xfce4-cellmodem-plugin-0.0.5/panel-plugin/preferences.c
1972+--- xfce4-cellmodem-plugin-0.0.5-orig/panel-plugin/preferences.c 2006-10-30 20:59:14.000000000 +0100
1973++++ xfce4-cellmodem-plugin-0.0.5/panel-plugin/preferences.c 2011-03-01 17:10:29.997567406 +0100
1974+@@ -254,7 +254,6 @@
1975+ cellmodem_create_options(XfcePanelPlugin *plugin, cellmodem_t *monitor)
1976+ {
1977+ GtkWidget *dlg;
1978+- GtkWidget *header;
1979+ GtkWidget *vbox;
1980+ /* GtkWidget *vbox2;*/
1981+ GtkSizeGroup *sizegr;
1982+@@ -269,7 +268,7 @@
1983+
1984+ xfce_panel_plugin_block_menu (plugin);
1985+
1986+- dlg = gtk_dialog_new_with_buttons (_("Configure Cell Modem Monitor"),
1987++ dlg = xfce_titled_dialog_new_with_buttons (_("Configure Cell Modem Monitor"),
1988+ GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (plugin))),
1989+ GTK_DIALOG_DESTROY_WITH_PARENT |
1990+ GTK_DIALOG_NO_SEPARATOR,
1991+@@ -280,14 +279,7 @@
1992+ monitor);
1993+
1994+
1995+- /* The header - this was most copied from other sources*/
1996+-
1997+- header = xfce_create_header (NULL, _("Cellular Modem Monitor"));
1998+- gtk_widget_set_size_request (GTK_BIN (header)->child, -1, 32);
1999+- gtk_container_set_border_width (GTK_CONTAINER (header), BORDER - 2);
2000+- gtk_widget_show (header);
2001+- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), header,
2002+- FALSE, TRUE, 0);
2003++ xfce_titled_dialog_set_subtitle (XFCE_TITLED_DIALOG(dlg), _("Cellular Modem Monitor"));
2004+
2005+ /* Our own Vbox, so we can have a border */
2006+
2007
2008=== modified file 'debian/patches/series'
2009--- debian/patches/series 2012-05-17 20:09:01 +0000
2010+++ debian/patches/series 2013-12-17 04:49:05 +0000
2011@@ -1,3 +1,4 @@
2012 01_typo-linking.patch
2013 02_explicit-linking-to-libxfcegui4.patch
2014 03_fix-crash-on-remove.patch
2015+04_port-to-libxfce4ui.patch
2016
2017=== modified file 'debian/rules'
2018--- debian/rules 2012-05-17 20:09:01 +0000
2019+++ debian/rules 2013-12-17 04:49:05 +0000
2020@@ -1,7 +1,7 @@
2021 #!/usr/bin/make -f
2022
2023 export DEB_LDFLAGS_MAINT_APPEND=-Wl,-z,defs -Wl,--as-needed -Wl,-O1
2024-export DEB_BUILD_MAINT_OPTIONS=hardening=+pie,+bindnow
2025+export DEB_BUILD_MAINT_OPTIONS=hardening=+all
2026
2027 override_dh_auto_configure:
2028 NOCONFIGURE=1 xdt-autogen
2029@@ -18,4 +18,4 @@
2030 rm -f po/POTFILES.skip
2031
2032 %:
2033- dh $@
2034+ dh $@ --parallel
2035
2036=== modified file 'panel-plugin/Makefile.am'
2037--- panel-plugin/Makefile.am 2011-06-27 22:39:05 +0000
2038+++ panel-plugin/Makefile.am 2013-12-17 04:49:05 +0000
2039@@ -3,12 +3,10 @@
2040
2041 xfce4_cellmodem_plugin_CFLAGS = \
2042 -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
2043- @LIBXFCE4PANEL_CFLAGS@ \
2044- @LIBXFCEGUI4_CFLAGS@
2045+ @LIBXFCE4PANEL_CFLAGS@
2046
2047-xfce4_cellmodem_plugin_LDADD = \
2048- @LIBXFCE4PANEL_LIBS@ \
2049- @LIBXFCEGUI4_LIBS@
2050+xfce4_cellmodem_plugin_LDFLAGS = \
2051+ @LIBXFCE4PANEL_LIBS@
2052
2053 xfce4_cellmodem_plugin_SOURCES = \
2054 cellmodem.c modem_driver.c \
2055
2056=== modified file 'panel-plugin/cellmodem.c'
2057--- panel-plugin/cellmodem.c 2012-05-17 20:09:01 +0000
2058+++ panel-plugin/cellmodem.c 2013-12-17 04:49:05 +0000
2059@@ -586,7 +586,7 @@
2060 */
2061
2062 static void
2063-cellmodem_t_delete(XfcePanelPlugin *plugin, cellmodem_t *monitor)
2064+cellmodem_t_delete(cellmodem_t *monitor)
2065 {
2066 DEBUG("Destroying cellmodem object");
2067 cellmodem_t_close_modem( monitor /*, TRUE*/ );

Subscribers

People subscribed via source and target branches

to all changes: