Exemplo n.º 1
0
		public static void Main (string[] argv)
		{
			Program app = new Program ("sampleapp", "0.0.1", Modules.UI, argv);

			Glade.XML gxml = new Glade.XML (null, "sample.glade", "preferences_dialog", null);
			gxml.Autoconnect (new X ());

			Settings.Changed += new NotifyEventHandler (Changed);

			EditorShell shell = new EditorShell (gxml);
			shell.Add (SettingKeys.Enable, "enable");
			shell.Add (SettingKeys.TheFilename, "fileentry");
			shell.Add (SettingKeys.TheInteger, "spinbutton_int");
			shell.Add (SettingKeys.TheFloat, "spinbutton_float");
			shell.Add (SettingKeys.TheFirstEnum, "optionmenu", typeof (Names));
			shell.Add (SettingKeys.TheSecondEnum, "radiobutton", typeof (Direction));
			shell.Add (SettingKeys.TheText, "entry");

			shell.AddGuard (SettingKeys.Enable, "table1");
			
			app.Run ();
		}
Exemplo n.º 2
0
        //string[] papersize = {"letter", "legal", "a4"};
        //string[] modemType = {@"-j\Q4",@"-j\Q1",@"-j*F1",@"-j&H2&I0&R1&D3I4",@"-or"};
        /*
        # FCINIT='-j\Q4'                # AT&T (Dataport, Paradyne)
        # FCINIT='-j\Q1'                # Motorola (Power Modem, 3400 Pro,...)
        # FCINIT='-j*F1'                # QuickComm (Spirit II)
        # FCINIT='-j&H2&I0&R1&D3I4'     # USR (Courier, Sportster)
        # FCINIT='-or'                  # Multi-Tech (for bit reversal)
        */
        public GfaxPrefs()
        {
            gxml = new Glade.XML (null, "gfax.glade","PrefsDialog",null);
            //GConf.PropertEditors
            EditorShell shell = new EditorShell (gxml);
            gxml.Autoconnect(this);

            // System Tab
            if (Settings.TransmitAgent == "hylafax") {
                HylafaxRadioButton.Active = true;
                CoverPageCheckButton.Visible = false;
                PrefsNotebook.GetNthPage(EFAX_PAGE).Hide();
            }
            else if (Settings.TransmitAgent == "efax") {
                EfaxRadioButton.Active = true;
                EmailNotifyCheckButton.Sensitive = false;
                EmailAddressEntry.Sensitive = false;
                Settings.SendNow = SendNowCheckButton.Active;
                FaxLogCheckButton.Visible = false;
                CoverPageCheckButton.Visible = false;
                Settings.HiResolution = HiResCheckButton.Active;

                PrefsNotebook.GetNthPage(HYLAFAX_PAGE).Hide();
            }

            // Set these regardless so they are set if we need them
            switch (Settings.EfaxPapersize) {
                case "letter":
                    EfaxPapersizeComboBox.Active = 0;
                    break;
                case "legal":
                    EfaxPapersizeComboBox.Active = 1;
                    break;
                case "a4":
                    EfaxPapersizeComboBox.Active = 2;
                    break;
                default:
                    EfaxPapersizeComboBox.Active = 0;
                    break;
            }
            //"-j\\Q4","-j\\Q1","-j*F1","-j&H2&I0&R1&D3I4","-or"
            switch (Settings.EfaxModemFcinit) {
                    case @"-j\Q4":
                        EfaxModemTypeComboBox.Active = 0;
                        break;
                    case @"-j\Q1":
                        EfaxModemTypeComboBox.Active = 1;
                        break;
                    case @"-j*F1":
                        EfaxModemTypeComboBox.Active = 2;
                        break;
                    case @"-j&H2&I0&R1&D3I4":
                        EfaxModemTypeComboBox.Active = 3;
                        break;
                    case @"-or":
                        EfaxModemTypeComboBox.Active = 4;
                        break;
                    default:
                        EfaxModemTypeComboBox.Active = 5;
                        break;
            }

            EfaxModemSpeakerVolumeComboBox.Active = Settings.EfaxModemSpeakerVolume;

            // changes that happen automagically
            shell.Add(SettingKeys.FaxNumber, "FaxNumberEntry");
            shell.Add(SettingKeys.PhonePrefix, "DialPrefixEntry");
            shell.Add(SettingKeys.FaxViewer, "FaxViewerEntry");

            // Hylafax Tab
            shell.Add(SettingKeys.Hostname, "HylafaxHostnameEntry");
            shell.Add(SettingKeys.Port, "HylafaxPortEntry");
            shell.Add(SettingKeys.Username, "HylafaxUsernameEntry");

            // Efax Tab
            shell.Add(SettingKeys.EfaxModemDevice, "EfaxModemDeviceEntry");

            // User tab
            shell.Add(SettingKeys.EmailNotify, "EmailNotifyCheckButton");
            shell.Add(SettingKeys.EmailAddress, "EmailAddressEntry");
            shell.Add(SettingKeys.SendNow, "SendNowCheckButton");
            shell.Add(SettingKeys.LogEnabled, "FaxLogCheckButton");
            shell.Add(SettingKeys.CoverPage, "CoverPageCheckButton");
            shell.Add(SettingKeys.HiResolution, "HiResCheckButton");

            eventsEnabled = true;
        }