This commit was generated by cvs2svn to compensate for changes in r164,
[gnokii.git] / xgnokii / xgnokii.c
index 8375be4..05cc9fd 100644 (file)
   Released under the terms of the GNU GPL, see file COPYING for more details.
 
   $Log$
-  Revision 1.1.1.1  2001/11/25 21:59:26  short
-  :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001
-
-  Revision 1.39  2001/11/08 16:34:20  pkot
-  Updates to work with new libsms
+  Revision 1.1.1.4  2002/04/03 00:08:26  short
+  Found in "gnokii-working" directory, some November-patches version
 
   Revision 1.38  2001/09/14 13:14:03  pkot
   Xgnokii WM fixes (Martin Lucina)
 #include "misc.h"
 #include "gsm-common.h"
 #include "gsm-api.h"
+#include "fbus-6110.h"
+#include "fbus-3810.h"
 #include "cfgreader.h"
-#include "phones/nk7110.h"
-#include "phones/nk6110.h"
-#include "phones/nk3110.h"
-#include "phones/nk2110.h"
 #include "xgnokii.h"
 #include "xgnokii_common.h"
 #include "xgnokii_lowlevel.h"
@@ -441,7 +436,7 @@ static gint Update (gpointer data)
   static gchar timeBuf[10];
   static gchar *anonym = "anonymous";
   static struct tm stm;
-  static gint smsNumber = 0;
+  static gint smsUsed = 0;
   static gint callTimerStart = 0;
   gint callTimer = 0;
   time_t t;
@@ -450,7 +445,7 @@ static gint Update (gpointer data)
 
 
   /* The number of SMS messages before second */
-  static int smsold=0;
+  static int smsUnRead=0;
 
   /* The number of second for we should display "Short Message Received" message */
   static int smsreceived=-1;
@@ -459,6 +454,8 @@ static gint Update (gpointer data)
 
   DrawNetwork (data, phoneMonitor.rfLevel);
 
+  if (phoneMonitor.powerSource == GPS_ACDC)
+    phoneMonitor.batteryLevel = ((gint) phoneMonitor.batteryLevel + 25) % 125;
   DrawBattery (data, phoneMonitor.batteryLevel);
 
   if (phoneMonitor.alarm)
@@ -472,15 +469,15 @@ static gint Update (gpointer data)
   {
     DrawSMS (data);
 
-    if (phoneMonitor.sms.unRead > smsold && smsold != -1)
+    if (phoneMonitor.sms.unRead > smsUnRead && smsUnRead != -1)
       smsreceived = 10;  /* The message "Short Message Received" is displayed for 10s */
   }
-  if (smsNumber != phoneMonitor.sms.number)
+  if (smsUsed != phoneMonitor.sms.used)
     GUIEventSend (GUI_EVENT_SMS_NUMBER_CHANGED);
 
-  smsold = phoneMonitor.sms.unRead;
+  smsUnRead = phoneMonitor.sms.unRead;
 
-  smsNumber = phoneMonitor.sms.number;
+  smsUsed = phoneMonitor.sms.used;
 
   pthread_mutex_unlock (&smsMutex);
 
@@ -2440,6 +2437,7 @@ static void ReadConfig (void)
 #ifndef WIN32
   xgnokiiConfig.xgnokiidir = DefaultXGnokiiDir;
 
+#if 0
   if (strstr(FB38_Information.Models, xgnokiiConfig.model) != NULL)
   {
     max_phonebook_number_length = 30;
@@ -2447,12 +2445,15 @@ static void ReadConfig (void)
   }
   else 
 #endif
+#endif
+#if 0
   if (strstr(FB61_Information.Models, xgnokiiConfig.model) != NULL)
   {
     max_phonebook_number_length = FB61_MAX_PHONEBOOK_NUMBER_LENGTH;
     max_phonebook_sim_number_length = FB61_MAX_PHONEBOOK_NUMBER_LENGTH;
   }
   else
+#endif
   {
     max_phonebook_number_length = max_phonebook_sim_number_length = GSM_MAX_PHONEBOOK_NUMBER_LENGTH;
   }