X-Git-Url: https://git.jankratochvil.net/?p=gnokii.git;a=blobdiff_plain;f=xgnokii%2Fxgnokii_contacts.c;h=d7c5f78f65a66cf07bbdcadb9c97312f7b47fc69;hp=6baacfce91d2f3872ce0d5149b80568ad8c01864;hb=a2dfc99dc499ea8600bf5178f8122125d7d7d557;hpb=1fdb423c0a2e33c1282bec25de66d9f40d56999b diff --git a/xgnokii/xgnokii_contacts.c b/xgnokii/xgnokii_contacts.c index 6baacfc..d7c5f78 100644 --- a/xgnokii/xgnokii_contacts.c +++ b/xgnokii/xgnokii_contacts.c @@ -1,15 +1,13 @@ /* - $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 . Released under the terms of the GNU GPL, see file COPYING for more details. + $Id$ + */ @@ -29,8 +27,12 @@ #include #include +#if __unices__ +# include +#endif #include +#include "gsm-api.h" #include "gsm-common.h" #include "xgnokii_contacts.h" #include "xgnokii_lowlevel.h" @@ -249,7 +251,7 @@ static void OkEditEntryDialog (GtkWidget *widget, gpointer data) max_phonebook_name_length); entry->entry.Name[max_phonebook_name_length] = '\0'; - if (phoneMonitor.supported & PM_EXTPBK) + if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) { } else @@ -295,7 +297,7 @@ because you save it into SIM memory!")); gtk_widget_show (errorDialog.dialog); } - if (phoneMonitor.supported & PM_EXTPBK) + if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) { } else @@ -329,7 +331,7 @@ because you save it into SIM memory!")); 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 @@ -354,7 +356,7 @@ because you save it into SIM memory!")); gtk_widget_show (errorDialog.dialog); } - if (phoneMonitor.supported & PM_EXTPBK) + if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) { } else @@ -391,7 +393,7 @@ because you save it into SIM memory!")); 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] = ""; @@ -471,7 +473,7 @@ static void OkNewEntryDialog(GtkWidget *widget, gpointer data ) max_phonebook_name_length); entry->entry.Name[max_phonebook_name_length] = '\0'; - if (phoneMonitor.supported & PM_EXTPBK) + if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) { } else @@ -509,7 +511,7 @@ because you save it into SIM memory!")); gtk_widget_show (errorDialog.dialog); } - if (phoneMonitor.supported & PM_EXTPBK) + if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) { } else @@ -535,7 +537,7 @@ because you save it into SIM memory!")); 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 @@ -560,7 +562,7 @@ because you save it into SIM memory!")); gtk_widget_show (errorDialog.dialog); } - if (phoneMonitor.supported & PM_EXTPBK) + if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) { } else @@ -603,7 +605,7 @@ because you save it into SIM memory!")); 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] = ""; @@ -702,7 +704,7 @@ static void OkChangeEntryDialog( GtkWidget *widget, gpointer data) 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] = ""; @@ -1075,7 +1077,7 @@ static void CreateEditDialog (EditEntryData *editEntryData, gchar *title, 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 (""); @@ -1095,7 +1097,7 @@ static void CreateEditDialog (EditEntryData *editEntryData, gchar *title, 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); @@ -1158,7 +1160,7 @@ static void EditPbEntry(PhonebookEntry *pbEntry, gint row) 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); @@ -1171,7 +1173,7 @@ static void EditPbEntry(PhonebookEntry *pbEntry, gint row) 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); @@ -1251,7 +1253,7 @@ void NewPbEntry(PhonebookEntry *pbEntry) 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), ""); @@ -1264,7 +1266,7 @@ void NewPbEntry(PhonebookEntry *pbEntry) 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); @@ -1295,7 +1297,7 @@ void DuplicatePbEntry (PhonebookEntry *pbEntry) 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); @@ -1308,7 +1310,7 @@ void DuplicatePbEntry (PhonebookEntry *pbEntry) 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); @@ -1892,7 +1894,7 @@ static GtkWidget *CreateSaveQuestionDialog (GtkSignalFunc SaveFunc, static void OkExtPbkDialog (GtkWidget *w, gpointer data) { ExtPbkDialog *d=(ExtPbkDialog*)data; - SMS_NumberType numtype; + GSM_NumberType numtype; gint i, found=999; gchar *chars; @@ -2028,7 +2030,7 @@ void GUI_RefreshContacts (void) 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] = ""; @@ -2218,6 +2220,7 @@ Setting max SIM entries to 100!\n")); mla->min = 1; mla->max = memoryStatus.MaxME; mla->type = GMT_ME; + mla->used = memoryStatus.UsedME; //MW mla->InsertEntry = InsertPBEntryME; mla->ReadFailed = ReadFailedPBEntry; @@ -2240,6 +2243,7 @@ Setting max SIM entries to 100!\n")); mla->min = 1; mla->max = memoryStatus.MaxSM; mla->type = GMT_SM; + mla->used = memoryStatus.UsedSM; //MW mla->InsertEntry = InsertPBEntrySM; mla->ReadFailed = ReadFailedPBEntry; @@ -2323,7 +2327,7 @@ inline void GUI_ShowContacts (void) 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) @@ -2357,7 +2361,7 @@ static void ExportVCARD (FILE *f) 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) @@ -2416,7 +2420,7 @@ static void ExportNative (FILE *f) 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) @@ -2682,7 +2686,7 @@ static bool ParseLine (GSM_PhonebookEntry *entry, gint *num, gchar *buf) 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); @@ -3116,7 +3120,7 @@ SelectContactData *GUI_SelectContactDialog (void) 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++) { @@ -3170,7 +3174,7 @@ SelectContactData *GUI_SelectContactDialog (void) 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] = ""; @@ -3271,7 +3275,6 @@ void GUI_CreateContactsWindow (void) 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); @@ -3367,7 +3370,7 @@ void GUI_CreateContactsWindow (void) 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++) {