/*
- $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.
+ $Id$
+
*/
#include <stdlib.h>
#include <string.h>
+#if __unices__
+# include <strings.h>
+#endif
#include <gtk/gtk.h>
+#include "gsm-api.h"
#include "gsm-common.h"
#include "xgnokii_contacts.h"
#include "xgnokii_lowlevel.h"
max_phonebook_name_length);
entry->entry.Name[max_phonebook_name_length] = '\0';
- if (phoneMonitor.supported & PM_EXTPBK)
+ if (GetModelFeature(FN_PHONEBOOK)==F_PBK71)
{
}
else
gtk_widget_show (errorDialog.dialog);
}
- if (phoneMonitor.supported & PM_EXTPBK)
+ if (GetModelFeature(FN_PHONEBOOK)==F_PBK71)
{
}
else
max_phonebook_name_length);
((EditEntryData*) data)->pbEntry->entry.Name[max_phonebook_name_length] = '\0';
- if (phoneMonitor.supported & PM_EXTPBK)
+ if (GetModelFeature(FN_PHONEBOOK)==F_PBK71)
{
}
else
gtk_widget_show (errorDialog.dialog);
}
- if (phoneMonitor.supported & PM_EXTPBK)
+ if (GetModelFeature(FN_PHONEBOOK)==F_PBK71)
{
}
else
clist_row[2] = "P";
else
clist_row[2] = "S";
- if (phoneMonitor.supported & PM_CALLERGROUP)
+ if (GetModelFeature(FN_CALLERGROUPS)!=0)
clist_row[3] = xgnokiiConfig.callerGroups[((EditEntryData*) data)->pbEntry->entry.Group];
else
clist_row[3] = "";
max_phonebook_name_length);
entry->entry.Name[max_phonebook_name_length] = '\0';
- if (phoneMonitor.supported & PM_EXTPBK)
+ if (GetModelFeature(FN_PHONEBOOK)==F_PBK71)
{
}
else
gtk_widget_show (errorDialog.dialog);
}
- if (phoneMonitor.supported & PM_EXTPBK)
+ if (GetModelFeature(FN_PHONEBOOK)==F_PBK71)
{
}
else
max_phonebook_name_length);
((EditEntryData*) data)->pbEntry->entry.Name[max_phonebook_name_length] = '\0';
- if (phoneMonitor.supported & PM_EXTPBK)
+ if (GetModelFeature(FN_PHONEBOOK)==F_PBK71)
{
}
else
gtk_widget_show (errorDialog.dialog);
}
- if (phoneMonitor.supported & PM_EXTPBK)
+ if (GetModelFeature(FN_PHONEBOOK)==F_PBK71)
{
}
else
clist_row[2] = "P";
else
clist_row[2] = "S";
- if (phoneMonitor.supported & PM_CALLERGROUP)
+ if (GetModelFeature(FN_CALLERGROUPS)!=0)
clist_row[3] = xgnokiiConfig.callerGroups[((EditEntryData*) data)->pbEntry->entry.Group];
else
clist_row[3] = "";
clist_row[2] = "P";
else
clist_row[2] = "S";
- if (phoneMonitor.supported & PM_CALLERGROUP)
+ if (GetModelFeature(FN_CALLERGROUPS)!=0)
clist_row[3] = xgnokiiConfig.callerGroups[newPbEntry->entry.Group];
else
clist_row[3] = "";
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
gtk_widget_show (label);
- if (phoneMonitor.supported & PM_EXTPBK)
+ if (GetModelFeature(FN_PHONEBOOK)==F_PBK71)
{
button = gtk_button_new ();
editEntryData->number = gtk_label_new ("");
gtk_widget_show (editEntryData->number);
}
-/* if (phoneMonitor.supported & PM_EXTPBK) {
+/* if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) {
hbox = gtk_hbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (editEntryData->dialog)->vbox), hbox);
gtk_entry_set_text (GTK_ENTRY (editEditEntryData.name), pbEntry->entry.Name);
- if (phoneMonitor.supported & PM_EXTPBK)
+ if (GetModelFeature(FN_PHONEBOOK)==F_PBK71)
gtk_label_set_text (GTK_LABEL (editEditEntryData.number), pbEntry->entry.Number);
else
gtk_entry_set_text (GTK_ENTRY (editEditEntryData.number), pbEntry->entry.Number);
gtk_option_menu_set_history( GTK_OPTION_MENU (editEditEntryData.group),
pbEntry->entry.Group);
- if (phoneMonitor.supported & PM_CALLERGROUP)
+ if (GetModelFeature(FN_CALLERGROUPS)!=0)
{
gtk_widget_show (editEditEntryData.group);
gtk_widget_show (editEditEntryData.groupLabel);
gtk_entry_set_text (GTK_ENTRY (newEditEntryData.name), "");
- if (phoneMonitor.supported & PM_EXTPBK)
+ if (GetModelFeature(FN_PHONEBOOK)==F_PBK71)
gtk_label_set_text (GTK_LABEL (newEditEntryData.number), "");
else
gtk_entry_set_text (GTK_ENTRY (newEditEntryData.number), "");
gtk_option_menu_set_history( GTK_OPTION_MENU (newEditEntryData.group),
pbEntry->entry.Group);
- if (phoneMonitor.supported & PM_CALLERGROUP)
+ if (GetModelFeature(FN_CALLERGROUPS)!=0)
{
gtk_widget_show (newEditEntryData.group);
gtk_widget_show (newEditEntryData.groupLabel);
gtk_entry_set_text (GTK_ENTRY (duplicateEditEntryData.name), pbEntry->entry.Name);
- if (phoneMonitor.supported & PM_EXTPBK)
+ if (GetModelFeature(FN_PHONEBOOK)==F_PBK71)
gtk_label_set_text (GTK_LABEL (duplicateEditEntryData.number), pbEntry->entry.Number);
else
gtk_entry_set_text (GTK_ENTRY (duplicateEditEntryData.number), pbEntry->entry.Number);
gtk_option_menu_set_history( GTK_OPTION_MENU (duplicateEditEntryData.group),
pbEntry->entry.Group);
- if (phoneMonitor.supported & PM_CALLERGROUP)
+ if (GetModelFeature(FN_CALLERGROUPS)!=0)
{
gtk_widget_show (duplicateEditEntryData.group);
gtk_widget_show (duplicateEditEntryData.groupLabel);
static void OkExtPbkDialog (GtkWidget *w, gpointer data) {
ExtPbkDialog *d=(ExtPbkDialog*)data;
- SMS_NumberType numtype;
+ GSM_NumberType numtype;
gint i, found=999;
gchar *chars;
row[2] = "P";
else
row[2] = "S";
- if (phoneMonitor.supported & PM_CALLERGROUP)
+ if (GetModelFeature(FN_CALLERGROUPS)!=0)
row[3] = xgnokiiConfig.callerGroups[pbEntry->entry.Group];
else
row[3] = "";
mla->min = 1;
mla->max = memoryStatus.MaxME;
mla->type = GMT_ME;
+ mla->used = memoryStatus.UsedME; //MW
mla->InsertEntry = InsertPBEntryME;
mla->ReadFailed = ReadFailedPBEntry;
mla->min = 1;
mla->max = memoryStatus.MaxSM;
mla->type = GMT_SM;
+ mla->used = memoryStatus.UsedSM; //MW
mla->InsertEntry = InsertPBEntrySM;
mla->ReadFailed = ReadFailedPBEntry;
GUI_Refresh ();
GUI_InitCallerGroupsInf ();
}
- gtk_clist_set_column_visibility (GTK_CLIST (clist), 3, phoneMonitor.supported & PM_CALLERGROUP);
+ gtk_clist_set_column_visibility (GTK_CLIST (clist), 3, (GetModelFeature(FN_CALLERGROUPS)!=0));
GUI_RefreshContacts ();
gtk_widget_show (GUI_ContactsWindow);
// if (!contactsMemoryInitialized)
fprintf (f, "X_GSM_CALLERGROUP:%d\n", pbEntry->entry.Group);
/* Add ext. pbk info if required */
- if (phoneMonitor.supported & PM_EXTPBK)
+ if (GetModelFeature(FN_PHONEBOOK)==F_PBK71)
for (j = 0; j < pbEntry->entry.SubEntriesCount; j++)
{
if (pbEntry->entry.SubEntries[j].EntryType == GSM_Number)
strcat (buf, buf2);
/* Add ext. pbk info if required */
- if (phoneMonitor.supported & PM_EXTPBK)
+ if (GetModelFeature(FN_PHONEBOOK)==F_PBK71)
{
for (j = 0; j < pbEntry->entry.SubEntriesCount; j++)
if (pbEntry->entry.SubEntries[j].EntryType==GSM_Number)
return FALSE;
if (i >= len)
return FALSE;
- entry->SubEntries[entry->SubEntriesCount].NumberType=(SMS_NumberType)strtol (s_num, &endptr, 10);
+ entry->SubEntries[entry->SubEntriesCount].NumberType=(GSM_NumberType)strtol (s_num, &endptr, 10);
if (s_num == endptr)
return FALSE;
buf += (i + 1);
gtk_clist_set_column_width (GTK_CLIST(selectContactData.clist), 1, 115);
gtk_clist_set_column_width (GTK_CLIST(selectContactData.clist), 3, 70);
gtk_clist_set_column_justification (GTK_CLIST(selectContactData.clist), 2, GTK_JUSTIFY_CENTER);
- gtk_clist_set_column_visibility (GTK_CLIST(selectContactData.clist), 3, phoneMonitor.supported & PM_CALLERGROUP);
+ gtk_clist_set_column_visibility (GTK_CLIST(selectContactData.clist), 3, (GetModelFeature(FN_CALLERGROUPS)!=0));
for (i = 0; i < 4; i++)
{
row[2] = "P";
else
row[2] = "S";
- if (phoneMonitor.supported & PM_CALLERGROUP)
+ if (GetModelFeature(FN_CALLERGROUPS)!=0)
row[3] = xgnokiiConfig.callerGroups[pbEntry->entry.Group];
else
row[3] = "";
InitMainMenu ();
contactsMemoryInitialized = FALSE;
GUI_ContactsWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_wmclass (GTK_WINDOW (GUI_ContactsWindow), "ContactsWindow", "Xgnokii");
gtk_window_set_title (GTK_WINDOW (GUI_ContactsWindow), _("Contacts"));
gtk_widget_set_usize (GTK_WIDGET (GUI_ContactsWindow), 436, 220);
//gtk_container_set_border_width (GTK_CONTAINER (GUI_ContactsWindow), 10);
gtk_clist_set_column_width (GTK_CLIST (clist), 1, 115);
gtk_clist_set_column_width (GTK_CLIST (clist), 3, 70);
gtk_clist_set_column_justification (GTK_CLIST (clist), 2, GTK_JUSTIFY_CENTER);
-// gtk_clist_set_column_visibility (GTK_CLIST (clist), 3, phoneMonitor.supported & PM_CALLERGROUP);
+// gtk_clist_set_column_visibility (GTK_CLIST (clist), 3, (GetModelFeature(FN_CALLERGROUPS)!=0));
for (i = 0; i < 4; i++)
{