Browse Source

Перевод на русский всего

master
Никита 6 years ago
parent
commit
8b0f4df7bf
  1. 68
      fileFinder/MainForm.Designer.cs
  2. 16
      fileFinder/MainForm.cs
  3. 1
      fileFinder/TaskController.cs

68
fileFinder/MainForm.Designer.cs

@ -33,15 +33,15 @@
this.dirSelectBtn = new System.Windows.Forms.Button(); this.dirSelectBtn = new System.Windows.Forms.Button();
this.fileUrlTextBox = new System.Windows.Forms.TextBox(); this.fileUrlTextBox = new System.Windows.Forms.TextBox();
this.splitContainer = new System.Windows.Forms.SplitContainer(); 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.handleSearchBtn = new System.Windows.Forms.Button();
this.innerQueryTextBox = new System.Windows.Forms.TextBox(); this.innerQueryTextBox = new System.Windows.Forms.TextBox();
this.nameQueryTextBox = new System.Windows.Forms.TextBox(); this.nameQueryTextBox = new System.Windows.Forms.TextBox();
this.waitOrPauseLabel = new System.Windows.Forms.Label(); this.waitOrPauseLabel = new System.Windows.Forms.Label();
this.bottomPanel = new System.Windows.Forms.Panel(); this.bottomPanel = new System.Windows.Forms.Panel();
this.infoLabel = new System.Windows.Forms.Label(); 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(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
this.splitContainer.Panel1.SuspendLayout(); this.splitContainer.Panel1.SuspendLayout();
this.splitContainer.Panel2.SuspendLayout(); this.splitContainer.Panel2.SuspendLayout();
@ -64,7 +64,7 @@
this.dirSelectBtn.Name = "dirSelectBtn"; this.dirSelectBtn.Name = "dirSelectBtn";
this.dirSelectBtn.Size = new System.Drawing.Size(120, 21); this.dirSelectBtn.Size = new System.Drawing.Size(120, 21);
this.dirSelectBtn.TabIndex = 2; this.dirSelectBtn.TabIndex = 2;
this.dirSelectBtn.Text = "Select Directory"; this.dirSelectBtn.Text = "Выбрать путь";
this.dirSelectBtn.UseVisualStyleBackColor = true; this.dirSelectBtn.UseVisualStyleBackColor = true;
this.dirSelectBtn.Click += new System.EventHandler(this.dirSelectBtn_Click); this.dirSelectBtn.Click += new System.EventHandler(this.dirSelectBtn_Click);
// //
@ -105,13 +105,40 @@
this.splitContainer.SplitterDistance = 88; this.splitContainer.SplitterDistance = 88;
this.splitContainer.TabIndex = 4; 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 // handleSearchBtn
// //
this.handleSearchBtn.Location = new System.Drawing.Point(668, 61); this.handleSearchBtn.Location = new System.Drawing.Point(668, 61);
this.handleSearchBtn.Name = "handleSearchBtn"; this.handleSearchBtn.Name = "handleSearchBtn";
this.handleSearchBtn.Size = new System.Drawing.Size(120, 21); this.handleSearchBtn.Size = new System.Drawing.Size(120, 21);
this.handleSearchBtn.TabIndex = 5; this.handleSearchBtn.TabIndex = 5;
this.handleSearchBtn.Text = "Start Task"; this.handleSearchBtn.Text = "Запустить поиск";
this.handleSearchBtn.UseVisualStyleBackColor = true; this.handleSearchBtn.UseVisualStyleBackColor = true;
this.handleSearchBtn.Click += new System.EventHandler(this.handleSearchBtn_Click); this.handleSearchBtn.Click += new System.EventHandler(this.handleSearchBtn_Click);
// //
@ -161,36 +188,9 @@
this.infoLabel.AutoSize = true; this.infoLabel.AutoSize = true;
this.infoLabel.Location = new System.Drawing.Point(0, 0); this.infoLabel.Location = new System.Drawing.Point(0, 0);
this.infoLabel.Name = "infoLabel"; 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.TabIndex = 0;
this.infoLabel.Text = "Time: 00:00:00 | Number of files: 0/0/0 | Current file: none"; this.infoLabel.Text = "Время: 00:00:00 | Кол-во файлов: 0/0/0 | Состояние: готов";
//
// 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 = "Искомый текст в файле:";
// //
// MainForm // MainForm
// //

16
fileFinder/MainForm.cs

@ -95,22 +95,22 @@ namespace fileFinder
case TaskState.Created: case TaskState.Created:
searchQueryModel = mainController.updateSearchQueryModel(fileUrlTextBox.Text, searchQueryModel = mainController.updateSearchQueryModel(fileUrlTextBox.Text,
nameQueryTextBox.Text, innerQueryTextBox.Text); nameQueryTextBox.Text, innerQueryTextBox.Text);
handleSearchBtn.Text = "Pause Task"; handleSearchBtn.Text = "Поставить на паузу";
mainController.beginTask(); mainController.beginTask();
changeVisibilityResultViewer(); changeVisibilityResultViewer();
TreeNode tN = await Task.Run(() => mainController.buildResultTree(searchQueryModel, progress)); TreeNode tN = await Task.Run(() => mainController.buildResultTree(searchQueryModel, progress));
if (tN != null) if (tN != null)
{ {
updateResultViewer(tN); updateResultViewer(tN);
handleSearchBtn.Text = "Start Task"; handleSearchBtn.Text = "Запустить поиск";
} }
break; break;
case TaskState.Work: case TaskState.Work:
handleSearchBtn.Text = "Resume Task"; handleSearchBtn.Text = "Продолжить";
mainController.pauseTask(); mainController.pauseTask();
break; break;
case TaskState.Pause: case TaskState.Pause:
handleSearchBtn.Text = "Pause Task"; handleSearchBtn.Text = "Поставить на паузу";
mainController.resumeTask(); mainController.resumeTask();
break; break;
case TaskState.Finished: case TaskState.Finished:
@ -142,8 +142,8 @@ namespace fileFinder
TimeSpan tS = mainController.elapsedTime(); TimeSpan tS = mainController.elapsedTime();
string fileNumCounters = rpm.matchingFiles + "/" + rpm.processedFiles + "/" + rpm.totalNumOfFiles; string fileNumCounters = rpm.matchingFiles + "/" + rpm.processedFiles + "/" + rpm.totalNumOfFiles;
string time = String.Format("{0:00}:{1:00}:{2:00}", tS.Hours, tS.Minutes, tS.Seconds); string time = String.Format("{0:00}:{1:00}:{2:00}", tS.Hours, tS.Minutes, tS.Seconds);
infoLabel.Text = "Time: " + time + " " + "| Number of files: " + fileNumCounters + infoLabel.Text = "Время: " + time + " " + "| Кол-во файлов: " + fileNumCounters +
" | Current file: " + fileUrl; " | Статус: " + fileUrl;
} }
@ -162,7 +162,7 @@ namespace fileFinder
{ {
TimeSpan tS = mainController.elapsedTime(); TimeSpan tS = mainController.elapsedTime();
string time = String.Format("{0:00}:{1:00}:{2:00}", tS.Hours, tS.Minutes, tS.Seconds); 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); infoLabel.Text.Substring(infoLabel.Text.IndexOf("|") + 1);
}; };
try { this.Invoke(refresh); } catch { } try { this.Invoke(refresh); } catch { }
@ -196,7 +196,7 @@ namespace fileFinder
if (!isFieldsChanged) if (!isFieldsChanged)
{ {
isFieldsChanged = true; isFieldsChanged = true;
handleSearchBtn.Text = "Start New Task"; handleSearchBtn.Text = "Начать поиск";
} }
} }
} }

1
fileFinder/TaskController.cs

@ -54,6 +54,7 @@ namespace fileFinder
{ {
TaskController controller = this; TaskController controller = this;
TreeNode itemsNode = new TreeNode(); TreeNode itemsNode = new TreeNode();
report.Report(createReport(null, "Индексирование заданного пути", 0, 0, 0));
List<string> foundFiles = getFileList(query.fileUrl, query.fileNameQuery); List<string> foundFiles = getFileList(query.fileUrl, query.fileNameQuery);
report.Report(createReport(null, null, 0, 0, foundFiles.Count)); report.Report(createReport(null, null, 0, 0, foundFiles.Count));

Loading…
Cancel
Save