/*
+ $Id$
+
X G N O K I I
A Linux/Unix GUI for Nokia mobile phones.
+ Copyright (C) 1999 Pavel Janík ml., Hugh Blemings
+ & Ján Derfiòák <ja@mail.upjs.sk>.
Released under the terms of the GNU GPL, see file COPYING for more details.
+ $Log$
+ 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)
+
+ Revision 1.37 2001/06/27 23:52:52 pkot
+ 7110/6210 updates (Marian Jancar)
+
+ Revision 1.36 2001/06/20 21:27:36 pkot
+ IrDA patch (Marian Jancar)
+
+ Revision 1.35 2001/05/24 20:47:30 chris
+ More updating of 7110 code and some of xgnokii_lowlevel changed over.
+
+ Revision 1.34 2001/03/23 08:24:56 ja
+ New preview for 6210 in xgnokii's logos module.
+
+ Revision 1.33 2001/03/19 23:43:47 pkot
+ Solaris/BSD '#if defined' cleanup
+
+ Revision 1.32 2001/03/13 01:21:39 pkot
+ *BSD updates (Bert Driehuis)
+
+ Revision 1.31 2001/03/05 10:42:02 ja
+ Pavel Machek's vcard and finegrained indicators patch.
+
+ Revision 1.30 2001/01/29 15:22:20 machek
+ Use integer as bitfield instead of struct of int:1.
+
+ Be able to read phonebook saved in gnokii format from xgnokii.
+
+ Revision 1.29 2001/01/15 21:10:20 ja
+ Better status reporting in xgnokii, fixed phone capabilities detection in xgnokii.
+
+ Revision 1.28 2000/12/20 11:49:25 ja
+ Bringing back to life smsd. It was broken after last Pawel update.
+
+ Revision 1.27 2000/12/19 16:18:21 pkot
+ configure script updates and added shared function for configfile reading
+
+
*/
#include <stdlib.h> /* for getenv */
#include "misc.h"
#include "gsm-common.h"
#include "gsm-api.h"
-#include "files/cfgreader.h"
+#include "fbus-6110.h"
+#include "fbus-3810.h"
+#include "cfgreader.h"
#include "xgnokii.h"
#include "xgnokii_common.h"
#include "xgnokii_lowlevel.h"
#include "xgnokii_xkeyb.h"
#include "xgnokii_calendar.h"
#include "xgnokii_logos.h"
-#include "xgnokii_xring.h"
#include "xgnokii_cfg.h"
#include "xgnokii_data.h"
-#include "newmodules/n6110.h"
#include "xpm/logo.xpm"
#include "xpm/background.xpm"
/* Local variables */
static char *DefaultXGnokiiDir = XGNOKIIDIR;
-static char *DefaultXGnokiiDocsDir = XGNOKIIDOCSDIR;
static bool SMSSettingsInitialized = FALSE;
static bool CallersGroupsInitialized = FALSE;
-static bool SMSFoldersInitialized = FALSE;
static gint hiddenCallDialog;
static guint splashRemoveHandler;
-GSM_SMSFolders folders;
-
static struct CallDialog {
GtkWidget *dialog;
GtkWidget *label;
GtkWidget *model;
GtkWidget *init;
GtkWidget *bindir;
- GtkWidget *serial, *infrared, *mbus;
+ GtkWidget *serial, *infrared, *irda;
} ConnectionWidgets;
typedef struct {
typedef struct {
GtkWidget *set;
GtkWidget *number;
- GtkWidget *defaultrecipient;
GtkWidget *format;
GtkWidget *validity;
GSM_MessageCenter smsSetting[MAX_SMS_CENTER];
static inline void Help1 (GtkWidget *w, gpointer data)
{
- gchar *indx = g_strdup_printf ("/%s/gnokii/xgnokii/main/index.htm", xgnokiiConfig.locale);
+ gchar *indx = g_strdup_printf ("/help/%s/index.html", xgnokiiConfig.locale);
Help (w, indx);
g_free (indx);
}
-void GUI_InitSMSFoldersInf (void)
-{
- if (SMSFoldersInitialized)
- return;
-
- GSM->GetSMSFolders(&folders);
-
- SMSFoldersInitialized = TRUE;
- GUIEventSend (GUI_EVENT_SMS_FOLDERS_CHANGED);
-}
void GUI_InitCallerGroupsInf (void)
{
xgnokiiConfig.callerGroups[4] = g_strndup( _("Other"), MAX_CALLER_GROUP_LENGTH);
xgnokiiConfig.callerGroups[5] = g_strndup( _("No group"), MAX_CALLER_GROUP_LENGTH);
- if (GetModelFeature(FN_CALLERGROUPS)!=0)
+ if (phoneMonitor.supported & PM_CALLERGROUP)
for (i = 0; i < 5; i++)
{
cg = (D_CallerGroup *) g_malloc (sizeof (D_CallerGroup));
261, 96);
}
+
int network_levels[] = {
152, 69, 11, 3,
138, 69, 11, 3,
92, 69, 11, 6
};
+
static inline void DrawBattery (GtkWidget *data, int batterylevel)
{
int i;
}
}
+
static inline void DrawSMS (GtkWidget *data)
{
gdk_draw_pixmap (Pixmap,
9, 9);
}
+
static inline void DrawText (GtkWidget *data, int at, char *text)
{
static GdkFont *Font;
- Font = gdk_font_load ("-misc-fixed-medium-r-*-*-*-90-*-*-*-*-*-*");
+ Font = gdk_font_load ("-misc-fixed-medium-r-*-*-*-90-*-*-*-*-iso8859-*");
gdk_draw_string (Pixmap,
Font,
GTK_WIDGET(data)->style->fg_gc[GTK_STATE_NORMAL],
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;
/* 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;
DrawBackground (data);
- DrawNetwork(data, phoneMonitor.rfLevel);
+ DrawNetwork (data, phoneMonitor.rfLevel);
- DrawBattery(data, phoneMonitor.batteryLevel);
+ if (phoneMonitor.powerSource == GPS_ACDC)
+ phoneMonitor.batteryLevel = ((gint) phoneMonitor.batteryLevel + 25) % 125;
+ DrawBattery (data, phoneMonitor.batteryLevel);
if (phoneMonitor.alarm)
DrawAlarm (data);
-
+
if (phoneMonitor.working)
DrawText (data, 25, phoneMonitor.working);
{
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);
for (i = 0; i < xgnokiiConfig.smsSets; i++)
{
- gchar *row[5];
+ gchar *row[4];
if (*(configDialogData.sms.smsSetting[i].Name) == '\0')
row[0] = g_strdup_printf (_("Set %d"), i + 1);
else
break;
}
- row[4] = g_strdup (configDialogData.sms.smsSetting[i].DefaultRecipient);
-
gtk_clist_append( GTK_CLIST (SMSClist), row);
- for (j = 0; j < 5; j++)
+ for (j = 0; j < 4; j++)
g_free (row[j]);
}
gtk_entry_set_text (GTK_ENTRY (configDialogData.connection.bindir), xgnokiiConfig.bindir);
- if (!strcmp(xgnokiiConfig.connection, "fbus"))
+ if(!strcmp(xgnokiiConfig.connection, "serial")) {
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (configDialogData.connection.serial), TRUE);
-
- if (!strcmp(xgnokiiConfig.connection, "infrared"))
+ } else if(!strcmp(xgnokiiConfig.connection, "infrared")) {
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (configDialogData.connection.infrared), TRUE);
-
- if (!strcmp(xgnokiiConfig.connection, "mbus"))
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (configDialogData.connection.mbus), TRUE);
+ } else {
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (configDialogData.connection.irda), TRUE);
+ }
/* Phone */
gtk_entry_set_text (GTK_ENTRY (configDialogData.phone.model), phoneMonitor.phone.model);
else
{
xgnokiiConfig.alarmSupported = TRUE;
- if (alarm->time.IsSet)
+ if (alarm->time.AlarmEnabled)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (configDialogData.alarm.alarmSwitch), TRUE);
else
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (configDialogData.alarm.alarmSwitch), FALSE);
g_free (alarm);
/* SMS */
- if (GetModelFeature(FN_SMS)!=0)
+ if (phoneMonitor.supported & PM_SMS)
{
gtk_widget_show (sms_option_frame);
GUI_InitSMSSettings ();
/* BUSINESS CARD */
- if (GetModelFeature(FN_SMS)!=0)
+ if (phoneMonitor.supported & PM_SMS)
{
gtk_widget_show (user_option_frame);
/* Groups */
- if (GetModelFeature(FN_CALLERGROUPS)!=0)
+ if (phoneMonitor.supported & PM_CALLERGROUP)
{
gtk_widget_show (cg_names_option_frame);
GUI_InitCallerGroupsInf ();
gtk_widget_hide (cg_names_option_frame);
/* Mail */
- if (GetModelFeature(FN_SMS)!=0)
+ if (phoneMonitor.supported & PM_SMS)
{
gtk_widget_show (mail_option_frame);
gtk_entry_set_text (GTK_ENTRY (configDialogData.mailbox),
gtk_entry_set_text (GTK_ENTRY (configDialogData.help),
xgnokiiConfig.helpviewer);
- if (GetModelFeature(FN_SMSCDEFAULT)!=0) {} else
- gtk_clist_set_column_visibility (GTK_CLIST (SMSClist), 4, (GetModelFeature(FN_SMSCDEFAULT)!=0));
-
optionsDialogIsOpened = TRUE;
gtk_widget_show (OptionsDialog);
}
e->data = NULL;
GUI_InsertEvent (e);
pthread_join (monitor_th, NULL);
-
- //need to correctly close connection
- GSM->Terminate();
-
gtk_main_quit();
}
{
GdkEventButton *bevent = (GdkEventButton *) event;
- if (GetModelFeature(FN_KEYPRESS)!=0)
+ if (phoneMonitor.supported & PM_KEYBOARD)
gtk_widget_show (xkeyb_menu_item);
else
gtk_widget_hide (xkeyb_menu_item);
- if (GetModelFeature(FN_NETMONITOR)!=0)
+ if (phoneMonitor.supported & PM_NETMONITOR)
gtk_widget_show (netmon_menu_item);
else
gtk_widget_hide (netmon_menu_item);
- if (GetModelFeature(FN_SMS)!=0)
+ if (phoneMonitor.supported & PM_SMS)
gtk_widget_show (sms_menu_item);
else
gtk_widget_hide (sms_menu_item);
- if (GetModelFeature(FN_CALENDAR)!=0)
+ if (phoneMonitor.supported & PM_CALENDAR)
gtk_widget_show (calendar_menu_item);
else
gtk_widget_hide (calendar_menu_item);
- if (GetModelFeature(FN_DTMF)!=0)
+ if (phoneMonitor.supported & PM_DTMF)
gtk_widget_show (dtmf_menu_item);
else
gtk_widget_hide (dtmf_menu_item);
- if (GetModelFeature(FN_SPEEDDIAL)!=0)
+ if (phoneMonitor.supported & PM_SPEEDDIAL)
gtk_widget_show (speedDial_menu_item);
else
gtk_widget_hide (speedDial_menu_item);
- if (GetModelFeature(FN_DATACALLS)!=0)
+ if (phoneMonitor.supported & PM_DATA)
gtk_widget_show (data_menu_item);
else
gtk_widget_hide (data_menu_item);
else if (event->x >= 190 && event->x <= 210 &&
event->y >= 70 && event->y <= 85)
{
- if (GetModelFeature(FN_SMS)==0)
+ if (!phoneMonitor.supported & PM_SMS)
phoneMonitor.working = _("SMS not supported!");
else
GUI_ShowSMS ();
else if (event->x >= 235 && event->x <= 248 &&
event->y >= 27 && event->y <= 75)
{
- if (GetModelFeature(FN_CALENDAR)==0)
+ if (!phoneMonitor.supported & PM_CALENDAR)
phoneMonitor.working = _("Calendar not supported!");
else
GUI_ShowCalendar ();
}
/* SMS */
- if (GetModelFeature(FN_SMS)!=0)
+ if (phoneMonitor.supported & PM_SMS)
{
for (i = 0; i < xgnokiiConfig.smsSets; i++)
xgnokiiConfig.smsSetting[i] = configDialogData.sms.smsSetting[i];
}
/* BUSINESS CARD */
- if (GetModelFeature(FN_SMS)!=0)
+ if (phoneMonitor.supported & PM_SMS)
{
g_free(xgnokiiConfig.user.name);
xgnokiiConfig.user.name = g_strdup (gtk_entry_get_text(GTK_ENTRY (configDialogData.user.name)));
}
/* GROUPS */
- if (GetModelFeature(FN_CALLERGROUPS)!=0)
+ if (phoneMonitor.supported & PM_CALLERGROUP)
{
for ( i = 0; i < 6; i++)
{
}
/* Mail */
- if (GetModelFeature(FN_SMS)!=0)
+ if (phoneMonitor.supported & PM_SMS)
{
g_free(xgnokiiConfig.mailbox);
xgnokiiConfig.mailbox = g_strdup (gtk_entry_get_text(GTK_ENTRY (configDialogData.mailbox)));
GUI_InsertEvent (e);
}
- if (GetModelFeature(FN_CALLERGROUPS)!=0)
+ if (phoneMonitor.supported & PM_CALLERGROUP)
{
cg = (D_CallerGroup *) g_malloc (sizeof (D_CallerGroup));
cg->number = 0;
gtk_signal_connect_object (GTK_OBJECT (logos_menu_item), "activate",
GTK_SIGNAL_FUNC (GUI_ShowLogosWindow), NULL);
gtk_widget_show(logos_menu_item);
-
- logos_menu_item = gtk_menu_item_new_with_label (_("Ringtones"));
- gtk_menu_append (GTK_MENU (menu), logos_menu_item);
- gtk_signal_connect_object (GTK_OBJECT (logos_menu_item), "activate",
- GTK_SIGNAL_FUNC (GUI_ShowRingtonesWindow), NULL);
- gtk_widget_show(logos_menu_item);
-
+
dtmf_menu_item = gtk_menu_item_new_with_label (_("DTMF"));
gtk_menu_append (GTK_MENU (menu), dtmf_menu_item);
gtk_signal_connect_object (GTK_OBJECT (dtmf_menu_item), "activate",
{
GtkWidget *dialog;
GtkWidget *button, *hbox, *label;
- gchar buf[200];
+ gchar buf[2000];
dialog = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (dialog), _("About"));
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox);
gtk_widget_show (hbox);
- g_snprintf (buf, 200, _("xgnokii version: %s\ngnokii version: %s\n\n\
-Copyright (C) 1999 Pavel Janík ml.,\nHugh Blemings & Jan Derfinak\n"), XVERSION, VERSION);
+ g_snprintf (buf, 2000, _("xgnokii version: %s\ngnokii version: %s\n\n\
+Copyright (C) 1999,2000 Pavel Janík ml.,\nHugh Blemings, Jan Derfinak and others\n\
+xgnokii is free software, covered by the GNU General Public License, and you are\n\
+welcome to change it and/or distribute copies of it under certain conditions.\n\
+There is absolutely no waranty for xgnokii. See GPL for details.\n"),
+ XVERSION, VERSION);
label = gtk_label_new ((gchar *) buf);
gtk_box_pack_start (GTK_BOX(hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
configDialogData.sms.smsSetting[GPOINTER_TO_INT(GTK_CLIST (SMSClist)->selection->data)].Number[GSM_MAX_SMS_CENTER_LENGTH]
= '\0';
- strncpy(configDialogData.sms.smsSetting
- [GPOINTER_TO_INT(GTK_CLIST (SMSClist)->selection->data)].DefaultRecipient,
- gtk_entry_get_text(GTK_ENTRY (configDialogData.sms.defaultrecipient)),
- GSM_MAX_RECIPIENT_LENGTH);
- configDialogData.sms.smsSetting[GPOINTER_TO_INT(GTK_CLIST (SMSClist)->selection->data)].DefaultRecipient[GSM_MAX_RECIPIENT_LENGTH]
- = '\0';
-
configDialogData.sms.smsSetting[GPOINTER_TO_INT(GTK_CLIST (SMSClist)->selection->data)].Format
= tempMessageSettings.Format;
static void ShowEditSMSSetDialog (GtkWidget *w, gpointer data)
{
static GtkWidget *dialog = NULL;
- GtkWidget *button, *label, *label2, *hbox, *hbox2, *menu, *item;
+ GtkWidget *button, *label, *hbox, *menu, *item;
if (GTK_CLIST (SMSClist)->selection == NULL)
return;
gtk_box_pack_end(GTK_BOX(hbox), configDialogData.sms.number, FALSE, FALSE, 2);
gtk_widget_show (configDialogData.sms.number);
- hbox2 = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox2, FALSE, FALSE, 9);
- if (GetModelFeature(FN_SMSCDEFAULT)!=0)
- gtk_widget_show (hbox2);
-
- label2 = gtk_label_new (_("Default recipient:"));
- gtk_box_pack_start(GTK_BOX(hbox2), label2, FALSE, FALSE, 2);
- if (GetModelFeature(FN_SMSCDEFAULT)!=0)
- gtk_widget_show (label2);
-
- configDialogData.sms.defaultrecipient = gtk_entry_new_with_max_length(GSM_MAX_RECIPIENT_LENGTH - 1);
- gtk_widget_set_usize (configDialogData.sms.defaultrecipient, 110, 22);
- gtk_box_pack_end(GTK_BOX(hbox2), configDialogData.sms.defaultrecipient, FALSE, FALSE, 2);
- if (GetModelFeature(FN_SMSCDEFAULT)!=0)
- gtk_widget_show (configDialogData.sms.defaultrecipient);
-
hbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, FALSE, FALSE, 9);
gtk_widget_show (hbox);
+
label = gtk_label_new (_("Sending Format:"));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2);
gtk_widget_show (label);
configDialogData.sms.smsSetting
[GPOINTER_TO_INT(GTK_CLIST (SMSClist)->selection->data)].Number);
- gtk_entry_set_text (GTK_ENTRY (configDialogData.sms.defaultrecipient),
- configDialogData.sms.smsSetting
- [GPOINTER_TO_INT(GTK_CLIST (SMSClist)->selection->data)].DefaultRecipient);
-
switch (configDialogData.sms.smsSetting
[GPOINTER_TO_INT(GTK_CLIST (SMSClist)->selection->data)].Format)
{
GtkWidget *button, *hbox, *vbox, *label, *notebook, *frame, *clistScrolledWindow;
register gint i;
GtkAdjustment *adj;
- gchar *titles[5] = { _("Set's name"), _("Center number"), _("Format"), _("Validity"), _("Default recipient")};
+ gchar *titles[4] = { _("Set's name"), _("Center number"), _("Format"), _("Validity")};
dialog = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (dialog), _("Options"));
gtk_widget_show (hbox);
label = gtk_label_new (_("Connection:"));
- gtk_box_pack_start (GTK_BOX(hbox), label, FALSE, FALSE, 3);
+ gtk_box_pack_start (GTK_BOX(hbox), label, FALSE, FALSE, 2);
gtk_widget_show (label);
configDialogData.connection.infrared = gtk_radio_button_new_with_label (NULL, _("infrared"));
gtk_box_pack_end (GTK_BOX (hbox), configDialogData.connection.infrared, TRUE, FALSE, 2);
gtk_widget_show (configDialogData.connection.infrared);
-
+
configDialogData.connection.serial = gtk_radio_button_new_with_label (
- gtk_radio_button_group (GTK_RADIO_BUTTON (configDialogData.connection.infrared)), _("fbus"));
+ gtk_radio_button_group (GTK_RADIO_BUTTON (configDialogData.connection.infrared)), _("serial"));
gtk_box_pack_end (GTK_BOX (hbox), configDialogData.connection.serial, TRUE, FALSE, 2);
gtk_widget_show (configDialogData.connection.serial);
-
- configDialogData.connection.mbus = gtk_radio_button_new_with_label (
- gtk_radio_button_group (GTK_RADIO_BUTTON (configDialogData.connection.serial)), _("mbus"));
- gtk_box_pack_end (GTK_BOX (hbox), configDialogData.connection.mbus, TRUE, FALSE, 2);
- gtk_widget_show (configDialogData.connection.mbus);
+
+ configDialogData.connection.irda = gtk_radio_button_new_with_label (
+ gtk_radio_button_group (GTK_RADIO_BUTTON (configDialogData.connection.infrared)), _("irda"));
+ gtk_box_pack_end (GTK_BOX (hbox), configDialogData.connection.irda, TRUE, FALSE, 2);
+ gtk_widget_show (configDialogData.connection.irda);
/*** Phone notebook ***/
frame = gtk_frame_new (_("Phone information"));
gtk_container_add (GTK_CONTAINER (vbox), hbox);
gtk_widget_show (hbox);
- label = gtk_label_new ("Names length:");
+ label = gtk_label_new (_("Names length:"));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2);
gtk_widget_show (label);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
gtk_widget_show (hbox);
- label = gtk_label_new ("SIM:");
+ label = gtk_label_new (_("SIM:"));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2);
gtk_widget_show (label);
gtk_box_pack_end (GTK_BOX (hbox), configDialogData.phone.phoneNameLen, FALSE, FALSE, 2);
gtk_widget_show (configDialogData.phone.phoneNameLen);
- label = gtk_label_new ("Phone:");
+ label = gtk_label_new (_("Phone:"));
gtk_box_pack_end (GTK_BOX (hbox), label, FALSE, FALSE, 2);
gtk_widget_show (label);
label = gtk_label_new (_("SMS"));
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), sms_option_frame, label);
- SMSClist = gtk_clist_new_with_titles (5, titles);
+ SMSClist = gtk_clist_new_with_titles (4, titles);
gtk_clist_set_shadow_type (GTK_CLIST (SMSClist), GTK_SHADOW_OUT);
gtk_clist_column_titles_passive (GTK_CLIST (SMSClist));
gtk_clist_set_auto_sort (GTK_CLIST (SMSClist), FALSE);
gtk_clist_set_column_width (GTK_CLIST (SMSClist), 1, 115);
gtk_clist_set_column_width (GTK_CLIST (SMSClist), 2, 40);
gtk_clist_set_column_width (GTK_CLIST (SMSClist), 3, 55);
- gtk_clist_set_column_width (GTK_CLIST (SMSClist), 4, 100);
// gtk_clist_set_column_justification (GTK_CLIST (SMSClist), 1, GTK_JUSTIFY_RIGHT);
clistScrolledWindow = gtk_scrolled_window_new (NULL, NULL);
TRUE, TRUE, 10);
gtk_widget_show (SMSClist);
-
gtk_widget_show (clistScrolledWindow);
hbox = gtk_hbox_new (FALSE, 0);
struct sigaction act;
GUI_MainWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_wmclass (GTK_WINDOW (GUI_MainWindow), "MainWindow", "Xgnokii");
+/* gtk_window_set_decorated (GTK_WINDOW (GUI_MainWindow), GTK_FALSE); */
gtk_widget_realize (GUI_MainWindow);
BackgroundPixmap = gdk_pixmap_create_from_xpm_d (GUI_MainWindow->window, &mask, &GUI_MainWindow->style->white, (gchar **) XPM_background);
GUI_CreateCalendarWindow ();
GUI_CreateLogosWindow ();
GUI_CreateDataWindow();
- GUI_CreateRingtonesWindow ();
CreateErrorDialog (&errorDialog, GUI_MainWindow);
CreateInfoDialog (&infoDialog, GUI_MainWindow);
CreateInCallDialog ();
act.sa_flags = SA_NOCLDSTOP;
sigaction (SIGCHLD, &act, NULL);
-#if defined(__svr4__) || defined(__FreeBSD__)
+#if __unices__
act.sa_handler = SIG_IGN;
sigemptyset (&(act.sa_mask));
sigaction (SIGALRM, &act, NULL);
static void ReadConfig (void)
{
- /* Read config file */
- if (CFG_ReadConfig(&xgnokiiConfig.model, &xgnokiiConfig.port,
- &xgnokiiConfig.initlength, &xgnokiiConfig.connection,
- &xgnokiiConfig.bindir, &xgnokiiConfig.synchronizetime,false) < 0) {
- exit(-1);
- }
-
-#ifndef WIN32
+#ifdef WIN32
+ xgnokiiConfig.locale = "";
+#else
if ((xgnokiiConfig.locale = getenv ("LC_ALL")) == NULL)
if ((xgnokiiConfig.locale = getenv ("LC_MESSAGES")) == NULL)
if ((xgnokiiConfig.locale = getenv ("LANG")) == NULL)
xgnokiiConfig.locale = "POSIX";
#endif
-
+ if (readconfig(&xgnokiiConfig.model, &xgnokiiConfig.port,
+ &xgnokiiConfig.initlength, &xgnokiiConfig.connection,
+ &xgnokiiConfig.bindir) < 0)
+ {
+ exit(-1);
+ }
+
GUI_ReadXConfig();
max_phonebook_name_length = atoi (xgnokiiConfig.maxPhoneLen);
max_phonebook_sim_name_length = atoi (xgnokiiConfig.maxSIMLen);
#ifndef WIN32
xgnokiiConfig.xgnokiidir = DefaultXGnokiiDir;
- xgnokiiConfig.xgnokiidocsdir = DefaultXGnokiiDocsDir;
+
+#if 0
+ if (strstr(FB38_Information.Models, xgnokiiConfig.model) != NULL)
+ {
+ max_phonebook_number_length = 30;
+ max_phonebook_sim_number_length = 30;
+ }
+ else
+#endif
#endif
- if (CheckModel (N6110_Information, xgnokiiConfig.model, CurrentConnectionType)) {
- max_phonebook_number_length = N6110_MAX_PHONEBOOK_NUMBER_LENGTH;
- max_phonebook_sim_number_length = N6110_MAX_PHONEBOOK_NUMBER_LENGTH;
+#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;
}
gtk_main ();
- return(0);
+ return (0);
}