Ejemplo n.º 1
0
        private void buttonNewConfig_Click(object sender, EventArgs e)
        {
            string name = StringInput.GetString("Create new config", "Name of the new configuration");

            comboConfig.Items.Add(name);
            comboConfig.SelectedIndex = comboConfig.Items.Count - 1;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Show the user a dialog requesting a snapshot name.
        /// If the name is iinvalid, ask him again until he sets a right name.
        /// If the user cancels, returns null.
        /// </summary>
        /// <returns></returns>
        private static string ReadSnapshotName(string currentSnapshotName)
        {
            string snapshotName = currentSnapshotName;

            do
            {
                snapshotName = StringInput.GetString(Trans.T("L_POSTPONED_JOB_NAME"), Trans.T("L_NAME_POSTPONED_JOB"), snapshotName, true);
                if (snapshotName == null)
                {
                    // User cancelled.
                    return(null);
                }
            } while (PendingPrintJob.IsInvalidSnapshotName(snapshotName));

            return(snapshotName);
        }
Ejemplo n.º 3
0
        private void toolNewFolder_Click(object sender, EventArgs e)
        {
            string foldername = StringInput.GetString(Trans.T("L_CREATE_FOLDER"), Trans.T("L_CREATE_FOLDER_INFO")).ToLower();

            if (foldername.Length == 0)
            {
                return;
            }
            int p = foldername.IndexOf('.');

            if (!SDCard.validate83Filename(foldername))
            {
                MessageBox.Show(Trans.T("L_NOT_VALID_83_FILENAME"), Trans.T("L_ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            Main.connection.injectManualCommand("M32 " + (currentDirectory.Length > 0?"/":"") + currentDirectory + foldername);
            RefreshFilenames();
        }