Exemplo n.º 1
0
        /// <summary>
        /// Updates during sim contacts reading
        /// </summary>
        private void ReadingUpdate()
        {
            PBar.SetValue(GlobalObjUI.SimADNPosition);
            mainwindow_Ui.StatusBar.ShowMessage(GlobalObjUI.LMan.GetString("readcontact") +
                                                GlobalObjUI.SimADNPosition.ToString("d3"));
            MainClass.QtWait();


            if (GlobalObjUI.SimADNStatus == 3 && !isEnd)
            {
                isEnd = true;
                // End with errors
                MainClass.ShowMessage(this, "ERROR", GlobalObjUI.SimADNError, MainClass.MessageType.Error);

                // Update gui widgets properties
                ScanSimAfter();

                // update gui widgets with results
                UpdateSimControls(false);
            }

            if (GlobalObjUI.SimADNStatus == 2 && !isEnd)
            {
                isEnd = true;

                // Extract contacts from records
                retStr = GlobalObjUI.FromRecordsToContacts();

                if (retStr != "")
                {
                    // error detected
                    MainClass.ShowMessage(this, "ERROR", retStr, MainClass.MessageType.Error);

                    // Update gui widgets properties
                    ScanSimAfter();

                    // update gui widgets with results
                    UpdateSimControls(false);
                }
                else
                {
                    // update ListView
                    List <string> rowContent = null;
                    foreach (Contact cnt in GlobalObjUI.SimContacts.SimContacts)
                    {
                        rowContent = new List <string>();
                        rowContent.Add(" ");
                        rowContent.Add(cnt.Description);
                        rowContent.Add(cnt.PhoneNumber);
                        new QTreeWidgetItem(mainwindow_Ui.LstSimContacts, rowContent);
                    }

                    // Update gui widgets properties
                    ScanSimAfter();

                    // update gui widgets with results
                    UpdateSimControls(true);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Updates during sim contacts reading
        /// </summary>
        private void ReadingUpdate()
        {
            PBar.Adjustment.Value = (double)GlobalObjUI.SimADNPosition;
            StatusBar.Push(1, GlobalObjUI.LMan.GetString("readcontact") +
                           GlobalObjUI.SimADNPosition.ToString("d3"));
            MainClass.GtkWait();


            if (GlobalObjUI.SimADNStatus == 3)
            {
                // End with errors
                MainClass.ShowMessage(MainWindow, "ERROR", GlobalObjUI.SimADNError, MessageType.Error);

                // Update gui widgets properties
                ScanSimAfter();

                // update gui widgets with results
                UpdateSimControls(false);
            }

            if (GlobalObjUI.SimADNStatus == 2)
            {
                // Extract contacts from records
                retStr = GlobalObjUI.FromRecordsToContacts();

                if (retStr != "")
                {
                    // error detected
                    MainClass.ShowMessage(MainWindow, "ERROR", retStr, MessageType.Error);

                    // Update gui widgets properties
                    ScanSimAfter();

                    // update gui widgets with results
                    UpdateSimControls(false);
                }
                else
                {
                    // update ListView
                    foreach (Contact cnt in GlobalObjUI.SimContacts.SimContacts)
                    {
                        lstSimContacts.AppendValues(new string[] { cnt.Description, cnt.PhoneNumber });
                    }

                    // Update gui widgets properties
                    ScanSimAfter();

                    // update gui widgets with results
                    UpdateSimControls(true);
                }
            }
        }