Пример #1
0
 private void FormToothChartingBig_Load(object sender, EventArgs e)
 {
     //ComputerPref computerPref=ComputerPrefs.GetForLocalComputer();
     toothChart.UseHardware = ComputerPrefs.LocalComputer.GraphicsUseHardware;
     toothChart.PreferredPixelFormatNumber = ComputerPrefs.LocalComputer.PreferredPixelFormatNum;
     toothChart.SetToothNumberingNomenclature((ToothNumberingNomenclature)PrefC.GetInt(PrefName.UseInternationalToothNumbers));
     //Must be last preference set, last so that all settings are caried through in the reinitialization this line triggers.
     if (ComputerPrefs.LocalComputer.GraphicsSimple == DrawingMode.Simple2D)
     {
         toothChart.DrawMode = DrawingMode.Simple2D;
     }
     else if (ComputerPrefs.LocalComputer.GraphicsSimple == DrawingMode.DirectX)
     {
         toothChart.DeviceFormat = new ToothChartDirectX.DirectXDeviceFormat(ComputerPrefs.LocalComputer.DirectXFormat);
         toothChart.DrawMode     = DrawingMode.DirectX;
     }
     else
     {
         toothChart.DrawMode = DrawingMode.OpenGL;
     }
     //The preferred pixel format number changes to the selected pixel format number after a context is chosen.
     ComputerPrefs.LocalComputer.PreferredPixelFormatNum = toothChart.PreferredPixelFormatNumber;
     ComputerPrefs.Update(ComputerPrefs.LocalComputer);
     FillToothChart();
     //toothChart.Refresh();
 }
Пример #2
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textScanDocQuality.errorProvider1.GetError(textScanDocQuality) != "" ||
         textScanDocResolution.errorProvider1.GetError(textScanDocResolution) != "")
     {
         MessageBox.Show(Lan.g(this, "Please fix data entry errors first."));
         return;
     }
     ComputerPrefs.LocalComputer.ScanDocSelectSource = checkScanDocSelectSource.Checked;
     ComputerPrefs.LocalComputer.ScanDocShowOptions  = radioScanDocShowOptions.Checked;
     ComputerPrefs.LocalComputer.ScanDocDuplex       = checkScanDocDuplex.Checked;
     ComputerPrefs.LocalComputer.ScanDocGrayscale    = checkScanDocGrayscale.Checked;
     ComputerPrefs.LocalComputer.ScanDocResolution   = PIn.Int(textScanDocResolution.Text);
     ComputerPrefs.LocalComputer.ScanDocQuality      = PIn.Byte(textScanDocQuality.Text);
     //Prefs.UpdateLong(PrefName.ScannerCompression,PIn.Long(textScanDocQuality.Text));
     Prefs.UpdateLong(PrefName.ImageWindowingMin, slider.MinVal);
     Prefs.UpdateLong(PrefName.ImageWindowingMax, slider.MaxVal);
     //Prefs.UpdateBool(PrefName.ScannerSuppressDialog,checkScanDocShowOptions.Checked);
     //Prefs.UpdateLong(PrefName.ScannerResolution,PIn.Long(textScanDocResolution.Text));
     ComputerPrefs.LocalComputer.SensorType     = comboType.Text;
     ComputerPrefs.LocalComputer.SensorPort     = (int)upDownPort.Value;
     ComputerPrefs.LocalComputer.SensorExposure = (int)upDownExposure.Value;
     ComputerPrefs.LocalComputer.SensorBinned   = checkBinned.Checked;
     ComputerPrefs.Update(ComputerPrefs.LocalComputer);
     DataValid.SetInvalid(InvalidType.Prefs);
     DialogResult = DialogResult.OK;
 }
Пример #3
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            OpenGLWinFormsControl contextTester = new OpenGLWinFormsControl();

            try {
                if (contextTester.TaoInitializeContexts(selectedFormatNum) != selectedFormatNum)
                {
                    throw new Exception(Lan.g(this, "Could not initialize pixel format ") + selectedFormatNum.ToString() + ".");
                }
            }
            catch (Exception ex) {
                MessageBox.Show(Lan.g(this, "Please choose a different pixel format, the selected pixel format will not support the 3D tooth chart on this computer: " + ex.Message));
                contextTester.Dispose();
                return;
            }
            contextTester.Dispose();
            ComputerPref computerPref = ComputerPrefs.GetForLocalComputer();

            computerPref.GraphicsUseHardware     = checkHardwareAccel.Checked;
            computerPref.GraphicsSimple          = radioSimpleChart.Checked;
            computerPref.GraphicsDoubleBuffering = checkDoubleBuffering.Checked;
            computerPref.PreferredPixelFormatNum = selectedFormatNum;
            ComputerPrefs.Update(computerPref);
            DialogResult = DialogResult.OK;
        }
Пример #4
0
 ///<summary>Set graphics for selected computer to simple.  Makes audit log entry.</summary>
 private void butSetSimpleGraphics_Click(object sender, EventArgs e)
 {
     if (listComputer.SelectedIndex == -1)
     {
         return;
     }
     ComputerPrefs.SetToSimpleGraphics(Computers.List[listComputer.SelectedIndex].CompName);
     SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "Set the graphics for computer " + Computers.List[listComputer.SelectedIndex].CompName + " to simple");
 }
Пример #5
0
        private void butOK_Click(object sender, EventArgs e)
        {
            if (validNumX.errorProvider1.GetError(validNumX) != "" | validNumY.errorProvider1.GetError(validNumY) != "")
            {
                MessageBox.Show(Lan.g(this, "Please fix data entry errors first."));
                return;
            }
            if (FormOpenDental.IsDashboardVisible && checkTaskListAlwaysShow.Checked && !checkBoxTaskKeepListHidden.Checked && radioRight.Checked)
            {
                MsgBox.Show(this, "Tasks cannot be docked to the right when Dashboards are in use.");
                return;
            }
            bool changed = false;

            if (Prefs.UpdateBool(PrefName.TaskListAlwaysShowsAtBottom, checkTaskListAlwaysShow.Checked)
                | Prefs.UpdateBool(PrefName.TasksUseRepeating, checkShowLegacyRepeatingTasks.Checked)
                | Prefs.UpdateBool(PrefName.TasksNewTrackedByUser, checkTasksNewTrackedByUser.Checked)
                | Prefs.UpdateBool(PrefName.TasksShowOpenTickets, checkShowOpenTickets.Checked)
                | Prefs.UpdateBool(PrefName.TaskSortApptDateTime, checkTaskSortApptDateTime.Checked)
                | Prefs.UpdateInt(PrefName.TasksGlobalFilterType, (int)comboGlobalFilter.GetSelected <GlobalTaskFilterType>())
                )
            {
                changed = true;
            }
            if (ComputerPrefs.LocalComputer.TaskKeepListHidden != checkBoxTaskKeepListHidden.Checked)
            {
                ComputerPrefs.LocalComputer.TaskKeepListHidden = checkBoxTaskKeepListHidden.Checked;
                changed = true;              //needed to trigger screen refresh
            }
            if (radioBottom.Checked && ComputerPrefs.LocalComputer.TaskDock != 0)
            {
                ComputerPrefs.LocalComputer.TaskDock = 0;
                changed = true;
            }
            else if (!radioBottom.Checked && ComputerPrefs.LocalComputer.TaskDock != 1)
            {
                ComputerPrefs.LocalComputer.TaskDock = 1;
                changed = true;
            }
            if (ComputerPrefs.LocalComputer.TaskX != PIn.Int(validNumX.Text))
            {
                ComputerPrefs.LocalComputer.TaskX = PIn.Int(validNumX.Text);
                changed = true;
            }
            if (ComputerPrefs.LocalComputer.TaskY != PIn.Int(validNumY.Text))
            {
                ComputerPrefs.LocalComputer.TaskY = PIn.Int(validNumY.Text);
                changed = true;
            }
            if (changed)
            {
                DataValid.SetInvalid(InvalidType.Prefs, InvalidType.Computers);
                ComputerPrefs.Update(ComputerPrefs.LocalComputer);
            }
            DialogResult = DialogResult.OK;
        }
Пример #6
0
        private void listComputer_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.GraphicsEdit))
            {
                return;
            }
            FormGraphics FormG = new FormGraphics();

            FormG.ComputerPrefCur = ComputerPrefs.GetForComputer(_listComputers[listComputer.SelectedIndex].CompName);
            FormG.ShowDialog();
        }
Пример #7
0
 ///<summary>Set graphics for selected computer to simple.  Makes audit log entry.</summary>
 private void butSetSimpleGraphics_Click(object sender, EventArgs e)
 {
     if (listComputer.SelectedIndex == -1)
     {
         MsgBox.Show(this, "You must select a computer name first.");
         return;
     }
     ComputerPrefs.SetToSimpleGraphics(_listComputers[listComputer.SelectedIndex].CompName);
     MsgBox.Show(this, "Done.");
     SecurityLogs.MakeLogEntry(Permissions.GraphicsEdit, 0, "Set the graphics for computer " + _listComputers[listComputer.SelectedIndex].CompName + " to simple");
 }
Пример #8
0
        /*
         * ///<summary>Returns true if the given path is part of the image paths stored in the database list, false otherwise.</summary>
         * public static bool IsImagePath(string path){
         *      string imagePaths=PrefC.GetString(PrefName.DocPath");
         *      return IsImagePath(path,imagePaths);
         * }*/

        private void butOK_Click(object sender, System.EventArgs e)
        {
            //remember that user might be using a website or a linux box to store images, therefore must allow forward slashes.
            if (radioUseFolder.Checked)
            {
                if (textLocalPath.Text != "")
                {
                    if (ImageStore.GetValidPathFromString(textLocalPath.Text) == null)
                    {
                        MsgBox.Show(this, "The path override for this computer is invalid.  The folder must exist and must contain all 26 A through Z folders.");
                        return;
                    }
                }
                else if (textServerPath.Text != "")
                {
                    if (ImageStore.GetValidPathFromString(textServerPath.Text) == null)
                    {
                        MsgBox.Show(this, "The path override for this server is invalid.  The folder must exist and must contain all 26 A through Z folders.");
                        return;
                    }
                }
                else
                {
                    if (ImageStore.GetValidPathFromString(textDocPath.Text) == null)
                    {
                        MsgBox.Show(this, "The path is invalid.  The folder must exist and must contain all 26 A through Z folders.");
                        return;
                    }
                }
            }
            if (Prefs.UpdateBool(PrefName.AtoZfolderUsed, radioUseFolder.Checked)
                | Prefs.UpdateString(PrefName.DocPath, textDocPath.Text)
                | Prefs.UpdateString(PrefName.ExportPath, textExportPath.Text)
                | Prefs.UpdateString(PrefName.LetterMergePath, textLetterMergePath.Text))
            {
                DataValid.SetInvalid(InvalidType.Prefs);
            }
            if (ImageStore.LocalAtoZpath != textLocalPath.Text)           //if local path changed
            {
                ImageStore.LocalAtoZpath = textLocalPath.Text;
                //ComputerPref compPref=ComputerPrefs.GetForLocalComputer();
                ComputerPrefs.LocalComputer.AtoZpath = ImageStore.LocalAtoZpath;
                ComputerPrefs.Update(ComputerPrefs.LocalComputer);
            }
            if (ReplicationServers.GetAtoZpath() != textServerPath.Text)
            {
                ReplicationServer server = ReplicationServers.GetForLocalComputer();
                server.AtoZpath = textServerPath.Text;
                ReplicationServers.Update(server);
                DataValid.SetInvalid(InvalidType.ReplicationServers);
            }
            DialogResult = DialogResult.OK;
        }
Пример #9
0
        private void butOK_Click(object sender, EventArgs e)
        {
            if (validNumX.errorProvider1.GetError(validNumX) != "" | validNumY.errorProvider1.GetError(validNumY) != "")
            {
                MessageBox.Show(Lan.g(this, "Please fix data entry errors first."));
                return;
            }
            bool changed = false;

            if (Prefs.UpdateBool(PrefName.TaskListAlwaysShowsAtBottom, checkTaskListAlwaysShow.Checked)
                | Prefs.UpdateBool(PrefName.TasksUseRepeating, checkShowLegacyRepeatingTasks.Checked)
                | Prefs.UpdateBool(PrefName.TasksNewTrackedByUser, checkTasksNewTrackedByUser.Checked)
                | Prefs.UpdateBool(PrefName.TasksShowOpenTickets, checkShowOpenTickets.Checked)
                | Prefs.UpdateBool(PrefName.TaskSortApptDateTime, checkTaskSortApptDateTime.Checked)
                )
            {
                changed = true;
            }
            if (ComputerPrefs.LocalComputer.TaskKeepListHidden != checkBoxTaskKeepListHidden.Checked)
            {
                ComputerPrefs.LocalComputer.TaskKeepListHidden = checkBoxTaskKeepListHidden.Checked;
                changed = true;              //needed to trigger screen refresh
            }
            if (radioBottom.Checked && ComputerPrefs.LocalComputer.TaskDock != 0)
            {
                ComputerPrefs.LocalComputer.TaskDock = 0;
                changed = true;
            }
            else if (!radioBottom.Checked && ComputerPrefs.LocalComputer.TaskDock != 1)
            {
                ComputerPrefs.LocalComputer.TaskDock = 1;
                changed = true;
            }
            if (ComputerPrefs.LocalComputer.TaskX != PIn.Int(validNumX.Text))
            {
                ComputerPrefs.LocalComputer.TaskX = PIn.Int(validNumX.Text);
                changed = true;
            }
            if (ComputerPrefs.LocalComputer.TaskY != PIn.Int(validNumY.Text))
            {
                ComputerPrefs.LocalComputer.TaskY = PIn.Int(validNumY.Text);
                changed = true;
            }
            if (changed)
            {
                DataValid.SetInvalid(InvalidType.Prefs, InvalidType.Computers);
                ComputerPrefs.Update(ComputerPrefs.LocalComputer);
            }
            DialogResult = DialogResult.OK;
        }
Пример #10
0
        private void FormToothChartingBig_Load(object sender, EventArgs e)
        {
            ComputerPref computerPref = ComputerPrefs.GetForLocalComputer();

            toothChart.UseHardware = computerPref.GraphicsUseHardware;
            toothChart.PreferredPixelFormatNumber = computerPref.PreferredPixelFormatNum;
            toothChart.SimpleMode = computerPref.GraphicsSimple;          //Must be last preference set, last so that all
            //settings are caried through in the reinitialization
            //this line triggers.
            //The preferred pixel format number changes to the selected pixel format number after a context is chosen.
            computerPref.PreferredPixelFormatNum = toothChart.PreferredPixelFormatNumber;
            ComputerPrefs.Update(computerPref);
            FillToothChart();
            //toothChart.Refresh();
        }
Пример #11
0
        private void FormGraphics_Load(object sender, EventArgs e)
        {
            gridFormats.BeginUpdate();
            gridFormats.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g(this, "FormatNum"), 80);

            gridFormats.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "OpenGL"), 60);
            gridFormats.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Windowed"), 80);
            gridFormats.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Bitmapped"), 80);
            gridFormats.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Palette"), 75);
            gridFormats.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Accelerated"), 80);
            gridFormats.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Buffered"), 75);
            gridFormats.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "ColorBits"), 75);
            gridFormats.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "DepthBits"), 75);
            gridFormats.Columns.Add(col);
            gridFormats.EndUpdate();
            if (Environment.OSVersion.Platform == PlatformID.Unix)           //Force simple mode on Unix systems.
            {
                MsgBox.Show(this, "Linux users must use simple graphics mode.");
                radio3DChart.Enabled      = false;
                group3DToothChart.Enabled = false;
                return;
            }
            ComputerPref computerPref = ComputerPrefs.GetForLocalComputer();

            if (computerPref.GraphicsSimple)
            {
                radioSimpleChart.Checked  = true;
                group3DToothChart.Enabled = false;
            }
            else
            {
                radio3DChart.Checked = true;
            }
            checkHardwareAccel.Checked   = computerPref.GraphicsUseHardware;
            checkDoubleBuffering.Checked = computerPref.GraphicsDoubleBuffering;
            selectedFormatNum            = computerPref.PreferredPixelFormatNum;
            textSelected.Text            = selectedFormatNum.ToString();
            RefreshFormats();
        }
Пример #12
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textDoc.errorProvider1.GetError(textDoc) != "")
     {
         MessageBox.Show(Lan.g(this, "Please fix data entry errors first."));
         return;
     }
     Prefs.UpdateInt("ScannerCompression", PIn.PInt(textDoc.Text));
     Prefs.UpdateInt("ImageWindowingMin", slider.MinVal);
     Prefs.UpdateInt("ImageWindowingMax", slider.MaxVal);
     computerPrefs.SensorType     = comboType.Text;
     computerPrefs.SensorPort     = (int)upDownPort.Value;
     computerPrefs.SensorExposure = (int)upDownExposure.Value;
     computerPrefs.SensorBinned   = checkBinned.Checked;
     ComputerPrefs.Update(computerPrefs);
     DataValid.SetInvalid(InvalidTypes.Prefs);
     DialogResult = DialogResult.OK;
 }
Пример #13
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            //ComputerPrefCur doesn't change until here, so make the old copy exactly when we need it instead of when the form is created.
            ComputerPref computerPrefOld = ComputerPrefCur.Copy();

            //ComputerPref computerPref=ComputerPrefs.GetForLocalComputer();
            if (radioDirectXChart.Checked)
            {
                if (!_isRemoteEdit && !TestDirectXFormat(this, selectedDirectXFormat))
                {
                    MessageBox.Show(Lan.g(this, "Please choose a different device format, " +
                                          "the selected device format will not support the DirectX 3D tooth chart on this computer"));
                    return;
                }
                ComputerPrefCur.GraphicsSimple = DrawingMode.DirectX;
                ComputerPrefCur.DirectXFormat  = selectedDirectXFormat;
            }
            else if (radioSimpleChart.Checked)
            {
                ComputerPrefCur.GraphicsSimple = DrawingMode.Simple2D;
            }
            else               //OpenGL
            {
                OpenGLWinFormsControl contextTester = new OpenGLWinFormsControl();
                try {
                    if (!_isRemoteEdit && contextTester.TaoInitializeContexts(selectedFormatNum) != selectedFormatNum)
                    {
                        throw new Exception(Lan.g(this, "Could not initialize pixel format ") + selectedFormatNum.ToString() + ".");
                    }
                }
                catch (Exception ex) {
                    MessageBox.Show(Lan.g(this, "Please choose a different pixel format, the selected pixel format will not support the 3D tooth chart on this computer: " + ex.Message));
                    contextTester.Dispose();
                    return;
                }
                contextTester.Dispose();
                ComputerPrefCur.GraphicsUseHardware     = checkHardwareAccel.Checked;
                ComputerPrefCur.GraphicsDoubleBuffering = checkDoubleBuffering.Checked;
                ComputerPrefCur.PreferredPixelFormatNum = selectedFormatNum;
                ComputerPrefCur.GraphicsSimple          = DrawingMode.OpenGL;
            }
            ComputerPrefs.Update(ComputerPrefCur, computerPrefOld);
            DialogResult = DialogResult.OK;
        }
Пример #14
0
 private void butOK_Click(object sender, EventArgs e)
 {
     if (comboLanguageAndRegion.SelectedIndex == -1)
     {
         MsgBox.Show(this, "Select a language and region.");
         return;
     }
     if (Security.IsAuthorized(Permissions.Setup, true))
     {
         //_cultureCur=_listAllCultures[comboLanguageAndRegion.SelectedIndex];
         if (Prefs.UpdateString(PrefName.LanguageAndRegion, _listAllCultures[comboLanguageAndRegion.SelectedIndex].Name))
         {
             MsgBox.Show(this, "Program must be restarted for changes to take full effect.");
         }
         ComputerPrefs.LocalComputer.NoShowLanguage = checkNoShow.Checked;
         ComputerPrefs.Update(ComputerPrefs.LocalComputer);
     }
     DialogResult = DialogResult.OK;
 }
Пример #15
0
        private void FormImagingSetup_Load(object sender, System.EventArgs e)
        {
            comboType.Items.Add("B");
            comboType.Items.Add("D");
            textDoc.Text        = PrefB.GetInt("ScannerCompression").ToString();
            slider.MinVal       = PrefB.GetInt("ImageWindowingMin");
            slider.MaxVal       = PrefB.GetInt("ImageWindowingMax");
            computerPrefs       = ComputerPrefs.GetForLocalComputer();
            upDownPort.Value    = computerPrefs.SensorPort;
            comboType.Text      = computerPrefs.SensorType;
            checkBinned.Checked = computerPrefs.SensorBinned;
            int exposureLevelVal = computerPrefs.SensorExposure;

            if (exposureLevelVal < (int)upDownExposure.Minimum || exposureLevelVal > (int)upDownExposure.Maximum)
            {
                exposureLevelVal = (int)upDownExposure.Minimum;              //Play it safe with the default exposure.
            }
            upDownExposure.Value = exposureLevelVal;
        }
Пример #16
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textScanDocQuality.errorProvider1.GetError(textScanDocQuality) != "" ||
         textScanDocResolution.errorProvider1.GetError(textScanDocResolution) != "")
     {
         MessageBox.Show(Lan.g(this, "Please fix data entry errors first."));
         return;
     }
     if (textScanDocQuality.Text == "100" ||
         (radioScanDocUseOptionsBelow.Checked && PIn.Int(textScanDocResolution.Text) > 300))
     {
         if (!MsgBox.Show(this, MsgBoxButtons.YesNo, "With the provided settings the file created may be extremely large.  Would you like to continue?"))
         {
             return;
         }
     }
     ComputerPrefs.LocalComputer.ScanDocSelectSource = checkScanDocSelectSource.Checked;
     ComputerPrefs.LocalComputer.ScanDocShowOptions  = radioScanDocShowOptions.Checked;
     ComputerPrefs.LocalComputer.ScanDocDuplex       = checkScanDocDuplex.Checked;
     ComputerPrefs.LocalComputer.ScanDocGrayscale    = checkScanDocGrayscale.Checked;
     ComputerPrefs.LocalComputer.ScanDocResolution   = PIn.Int(textScanDocResolution.Text);
     ComputerPrefs.LocalComputer.ScanDocQuality      = PIn.Byte(textScanDocQuality.Text);
     //Prefs.UpdateLong(PrefName.ScannerCompression,PIn.Long(textScanDocQuality.Text));
     Prefs.UpdateLong(PrefName.ImageWindowingMin, slider.MinVal);
     Prefs.UpdateLong(PrefName.ImageWindowingMax, slider.MaxVal);
     //Prefs.UpdateBool(PrefName.ScannerSuppressDialog,checkScanDocShowOptions.Checked);
     //Prefs.UpdateLong(PrefName.ScannerResolution,PIn.Long(textScanDocResolution.Text));
     ComputerPrefs.LocalComputer.SensorType     = comboType.Text;
     ComputerPrefs.LocalComputer.SensorPort     = (int)upDownPort.Value;
     ComputerPrefs.LocalComputer.SensorExposure = (int)upDownExposure.Value;
     ComputerPrefs.LocalComputer.SensorBinned   = checkBinned.Checked;
     ComputerPrefs.Update(ComputerPrefs.LocalComputer);
     DataValid.SetInvalid(InvalidType.Prefs);
     if (_scanDocSelectSourceOld != checkScanDocSelectSource.Checked)
     {
         SecurityLogs.MakeLogEntry(Permissions.Setup, 0
                                   , Lan.g(this, "Show Select Scanner Window option changed from") + " "
                                   + (_scanDocSelectSourceOld?Lan.g(this, "true"):Lan.g(this, "false")) + " "
                                   + Lan.g(this, "to") + " " + (checkScanDocSelectSource.Checked?Lan.g(this, "true"):Lan.g(this, "false")));
     }
     DialogResult = DialogResult.OK;
 }
Пример #17
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textDoc.errorProvider1.GetError(textDoc) != "" ||
         textScanningResolution.errorProvider1.GetError(textScanningResolution) != "")
     {
         MessageBox.Show(Lan.g(this, "Please fix data entry errors first."));
         return;
     }
     Prefs.UpdateLong(PrefName.ScannerCompression, PIn.Long(textDoc.Text));
     Prefs.UpdateLong(PrefName.ImageWindowingMin, slider.MinVal);
     Prefs.UpdateLong(PrefName.ImageWindowingMax, slider.MaxVal);
     Prefs.UpdateBool(PrefName.ScannerSuppressDialog, checkBoxSuppressScanDialog.Checked);
     Prefs.UpdateLong(PrefName.ScannerResolution, PIn.Long(textScanningResolution.Text));
     ComputerPrefs.LocalComputer.SensorType     = comboType.Text;
     ComputerPrefs.LocalComputer.SensorPort     = (int)upDownPort.Value;
     ComputerPrefs.LocalComputer.SensorExposure = (int)upDownExposure.Value;
     ComputerPrefs.LocalComputer.SensorBinned   = checkBinned.Checked;
     ComputerPrefs.Update(ComputerPrefs.LocalComputer);
     DataValid.SetInvalid(InvalidType.Prefs);
     DialogResult = DialogResult.OK;
 }
Пример #18
0
 private void butOK_Click(object sender, EventArgs e)
 {
     ComputerPrefs.LocalComputer.NoShowDecimal = checkNoShow.Checked;
     ComputerPrefs.Update(ComputerPrefs.LocalComputer);
     DialogResult = DialogResult.OK;
 }
Пример #19
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (validNumX.errorProvider1.GetError(validNumX) != ""
                | validNumY.errorProvider1.GetError(validNumY) != "")
            {
                MessageBox.Show(Lan.g(this, "Please fix data entry errors first."));
                return;
            }
            bool changed = false;

            if (Prefs.UpdateString(PrefName.MainWindowTitle, textMainWindowTitle.Text)
                | Prefs.UpdateLong(PrefName.ShowIDinTitleBar, comboShowID.SelectedIndex)
                | Prefs.UpdateBool(PrefName.TaskListAlwaysShowsAtBottom, checkTaskListAlwaysShow.Checked)
                | Prefs.UpdateBool(PrefName.TasksCheckOnStartup, checkTasksCheckOnStartup.Checked)
                | Prefs.UpdateBool(PrefName.TasksNewTrackedByUser, checkTasksNewTrackedByUser.Checked)
                | Prefs.UpdateBool(PrefName.TasksShowOpenTickets, checkShowOpenTickets.Checked)
                | Prefs.UpdateBool(PrefName.TitleBarShowSite, checkTitleBarShowSite.Checked)
                | Prefs.UpdateString(PrefName.WebServiceServerName, textWebServiceServerName.Text)
                | Prefs.UpdateBool(PrefName.ReportsPPOwriteoffDefaultToProcDate, checkReportsProcDate.Checked)
                | Prefs.UpdateBool(PrefName.ReportsShowPatNum, checkReportsShowPatNum.Checked)
                | Prefs.UpdateBool(PrefName.ReportPandIschedProdSubtractsWO, checkReportProdWO.Checked)
                )
            {
                changed = true;
            }
            //task list------------------------------------------------------------------------------------------
            if (ComputerPrefs.LocalComputer.TaskKeepListHidden != checkBoxTaskKeepListHidden.Checked)
            {
                ComputerPrefs.LocalComputer.TaskKeepListHidden = checkBoxTaskKeepListHidden.Checked;
                changed = true;              //needed to trigger screen refresh
            }
            if (radioBottom.Checked && ComputerPrefs.LocalComputer.TaskDock != 0)
            {
                ComputerPrefs.LocalComputer.TaskDock = 0;
                changed = true;
            }
            else if (!radioBottom.Checked && ComputerPrefs.LocalComputer.TaskDock != 1)
            {
                ComputerPrefs.LocalComputer.TaskDock = 1;
                changed = true;
            }
            if (ComputerPrefs.LocalComputer.TaskX != PIn.Int(validNumX.Text))
            {
                ComputerPrefs.LocalComputer.TaskX = PIn.Int(validNumX.Text);
                changed = true;
            }
            if (ComputerPrefs.LocalComputer.TaskY != PIn.Int(validNumY.Text))
            {
                ComputerPrefs.LocalComputer.TaskY = PIn.Int(validNumY.Text);
                changed = true;
            }
            //end of tasklist section-----------------------------------------------------------------------------
            if (textSigInterval.Text == "")
            {
                if (Prefs.UpdateLong(PrefName.ProcessSigsIntervalInSecs, 0))
                {
                    changed = true;
                }
            }
            else
            {
                if (Prefs.UpdateLong(PrefName.ProcessSigsIntervalInSecs, PIn.Long(textSigInterval.Text)))
                {
                    changed = true;
                }
            }
            if (changed)
            {
                DataValid.SetInvalid(InvalidType.Prefs, InvalidType.Computers);
                ComputerPrefs.Update(ComputerPrefs.LocalComputer);
            }
            DialogResult = DialogResult.OK;
        }