From 8b0f4df7bf79300ec2e1ae6be7f803977008a4d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=B8=D1=82=D0=B0?= Date: Thu, 4 Oct 2018 03:18:34 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B2=D0=BE=D0=B4=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=80=D1=83=D1=81=D1=81=D0=BA=D0=B8=D0=B9=20?= =?UTF-8?q?=D0=B2=D1=81=D0=B5=D0=B3=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fileFinder/MainForm.Designer.cs | 68 ++++++++++++++++----------------- fileFinder/MainForm.cs | 16 ++++---- fileFinder/TaskController.cs | 1 + 3 files changed, 43 insertions(+), 42 deletions(-) diff --git a/fileFinder/MainForm.Designer.cs b/fileFinder/MainForm.Designer.cs index 222c7ad..a7745b4 100644 --- a/fileFinder/MainForm.Designer.cs +++ b/fileFinder/MainForm.Designer.cs @@ -33,15 +33,15 @@ this.dirSelectBtn = new System.Windows.Forms.Button(); this.fileUrlTextBox = new System.Windows.Forms.TextBox(); this.splitContainer = new System.Windows.Forms.SplitContainer(); + this.fileInnerQueryLabel = new System.Windows.Forms.Label(); + this.fileNameQueryLabel = new System.Windows.Forms.Label(); + this.fileUrlLabel = new System.Windows.Forms.Label(); this.handleSearchBtn = new System.Windows.Forms.Button(); this.innerQueryTextBox = new System.Windows.Forms.TextBox(); this.nameQueryTextBox = new System.Windows.Forms.TextBox(); this.waitOrPauseLabel = new System.Windows.Forms.Label(); this.bottomPanel = new System.Windows.Forms.Panel(); this.infoLabel = new System.Windows.Forms.Label(); - this.fileUrlLabel = new System.Windows.Forms.Label(); - this.fileNameQueryLabel = new System.Windows.Forms.Label(); - this.fileInnerQueryLabel = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); this.splitContainer.Panel1.SuspendLayout(); this.splitContainer.Panel2.SuspendLayout(); @@ -64,7 +64,7 @@ this.dirSelectBtn.Name = "dirSelectBtn"; this.dirSelectBtn.Size = new System.Drawing.Size(120, 21); this.dirSelectBtn.TabIndex = 2; - this.dirSelectBtn.Text = "Select Directory"; + this.dirSelectBtn.Text = "Выбрать путь"; this.dirSelectBtn.UseVisualStyleBackColor = true; this.dirSelectBtn.Click += new System.EventHandler(this.dirSelectBtn_Click); // @@ -105,13 +105,40 @@ this.splitContainer.SplitterDistance = 88; this.splitContainer.TabIndex = 4; // + // fileInnerQueryLabel + // + this.fileInnerQueryLabel.AutoSize = true; + this.fileInnerQueryLabel.Location = new System.Drawing.Point(12, 65); + this.fileInnerQueryLabel.Name = "fileInnerQueryLabel"; + this.fileInnerQueryLabel.Size = new System.Drawing.Size(133, 13); + this.fileInnerQueryLabel.TabIndex = 6; + this.fileInnerQueryLabel.Text = "Искомый текст в файле:"; + // + // fileNameQueryLabel + // + this.fileNameQueryLabel.AutoSize = true; + this.fileNameQueryLabel.Location = new System.Drawing.Point(12, 39); + this.fileNameQueryLabel.Name = "fileNameQueryLabel"; + this.fileNameQueryLabel.Size = new System.Drawing.Size(119, 13); + this.fileNameQueryLabel.TabIndex = 6; + this.fileNameQueryLabel.Text = "Шаблон имени файла:"; + // + // fileUrlLabel + // + this.fileUrlLabel.AutoSize = true; + this.fileUrlLabel.Location = new System.Drawing.Point(12, 13); + this.fileUrlLabel.Name = "fileUrlLabel"; + this.fileUrlLabel.Size = new System.Drawing.Size(76, 13); + this.fileUrlLabel.TabIndex = 6; + this.fileUrlLabel.Text = "Путь к папке:"; + // // handleSearchBtn // this.handleSearchBtn.Location = new System.Drawing.Point(668, 61); this.handleSearchBtn.Name = "handleSearchBtn"; this.handleSearchBtn.Size = new System.Drawing.Size(120, 21); this.handleSearchBtn.TabIndex = 5; - this.handleSearchBtn.Text = "Start Task"; + this.handleSearchBtn.Text = "Запустить поиск"; this.handleSearchBtn.UseVisualStyleBackColor = true; this.handleSearchBtn.Click += new System.EventHandler(this.handleSearchBtn_Click); // @@ -161,36 +188,9 @@ this.infoLabel.AutoSize = true; this.infoLabel.Location = new System.Drawing.Point(0, 0); this.infoLabel.Name = "infoLabel"; - this.infoLabel.Size = new System.Drawing.Size(278, 13); + this.infoLabel.Size = new System.Drawing.Size(301, 13); this.infoLabel.TabIndex = 0; - this.infoLabel.Text = "Time: 00:00:00 | Number of files: 0/0/0 | Current file: none"; - // - // fileUrlLabel - // - this.fileUrlLabel.AutoSize = true; - this.fileUrlLabel.Location = new System.Drawing.Point(12, 13); - this.fileUrlLabel.Name = "fileUrlLabel"; - this.fileUrlLabel.Size = new System.Drawing.Size(76, 13); - this.fileUrlLabel.TabIndex = 6; - this.fileUrlLabel.Text = "Путь к папке:"; - // - // fileNameQueryLabel - // - this.fileNameQueryLabel.AutoSize = true; - this.fileNameQueryLabel.Location = new System.Drawing.Point(12, 39); - this.fileNameQueryLabel.Name = "fileNameQueryLabel"; - this.fileNameQueryLabel.Size = new System.Drawing.Size(119, 13); - this.fileNameQueryLabel.TabIndex = 6; - this.fileNameQueryLabel.Text = "Шаблон имени файла:"; - // - // fileInnerQueryLabel - // - this.fileInnerQueryLabel.AutoSize = true; - this.fileInnerQueryLabel.Location = new System.Drawing.Point(12, 65); - this.fileInnerQueryLabel.Name = "fileInnerQueryLabel"; - this.fileInnerQueryLabel.Size = new System.Drawing.Size(133, 13); - this.fileInnerQueryLabel.TabIndex = 6; - this.fileInnerQueryLabel.Text = "Искомый текст в файле:"; + this.infoLabel.Text = "Время: 00:00:00 | Кол-во файлов: 0/0/0 | Состояние: готов"; // // MainForm // diff --git a/fileFinder/MainForm.cs b/fileFinder/MainForm.cs index 5a761e0..f6492b4 100644 --- a/fileFinder/MainForm.cs +++ b/fileFinder/MainForm.cs @@ -95,22 +95,22 @@ namespace fileFinder case TaskState.Created: searchQueryModel = mainController.updateSearchQueryModel(fileUrlTextBox.Text, nameQueryTextBox.Text, innerQueryTextBox.Text); - handleSearchBtn.Text = "Pause Task"; + handleSearchBtn.Text = "Поставить на паузу"; mainController.beginTask(); changeVisibilityResultViewer(); TreeNode tN = await Task.Run(() => mainController.buildResultTree(searchQueryModel, progress)); if (tN != null) { updateResultViewer(tN); - handleSearchBtn.Text = "Start Task"; + handleSearchBtn.Text = "Запустить поиск"; } break; case TaskState.Work: - handleSearchBtn.Text = "Resume Task"; + handleSearchBtn.Text = "Продолжить"; mainController.pauseTask(); break; case TaskState.Pause: - handleSearchBtn.Text = "Pause Task"; + handleSearchBtn.Text = "Поставить на паузу"; mainController.resumeTask(); break; case TaskState.Finished: @@ -142,8 +142,8 @@ namespace fileFinder TimeSpan tS = mainController.elapsedTime(); string fileNumCounters = rpm.matchingFiles + "/" + rpm.processedFiles + "/" + rpm.totalNumOfFiles; string time = String.Format("{0:00}:{1:00}:{2:00}", tS.Hours, tS.Minutes, tS.Seconds); - infoLabel.Text = "Time: " + time + " " + "| Number of files: " + fileNumCounters + - " | Current file: " + fileUrl; + infoLabel.Text = "Время: " + time + " " + "| Кол-во файлов: " + fileNumCounters + + " | Статус: " + fileUrl; } @@ -162,7 +162,7 @@ namespace fileFinder { TimeSpan tS = mainController.elapsedTime(); string time = String.Format("{0:00}:{1:00}:{2:00}", tS.Hours, tS.Minutes, tS.Seconds); - infoLabel.Text = "Time: " + time + " |" + + infoLabel.Text = "Время: " + time + " |" + infoLabel.Text.Substring(infoLabel.Text.IndexOf("|") + 1); }; try { this.Invoke(refresh); } catch { } @@ -196,7 +196,7 @@ namespace fileFinder if (!isFieldsChanged) { isFieldsChanged = true; - handleSearchBtn.Text = "Start New Task"; + handleSearchBtn.Text = "Начать поиск"; } } } diff --git a/fileFinder/TaskController.cs b/fileFinder/TaskController.cs index c362e54..48a7b96 100644 --- a/fileFinder/TaskController.cs +++ b/fileFinder/TaskController.cs @@ -54,6 +54,7 @@ namespace fileFinder { TaskController controller = this; TreeNode itemsNode = new TreeNode(); + report.Report(createReport(null, "Индексирование заданного пути", 0, 0, 0)); List foundFiles = getFileList(query.fileUrl, query.fileNameQuery); report.Report(createReport(null, null, 0, 0, foundFiles.Count));