• R/O
  • SSH
  • HTTPS

scfiler: Commit


Commit MetaInfo

Revisão94 (tree)
Hora2009-05-22 01:52:29
Autoryuki_sc

Mensagem de Log

サムネイル表示中に削除などで表示対象アイテムが変更されたときの表示更新に対応

Mudança Sumário

Diff

--- SCFiler2/FileView.cs (revision 93)
+++ SCFiler2/FileView.cs (revision 94)
@@ -470,9 +470,9 @@
470470 SCFiler2System system = SCFiler2System.Instance;
471471
472472 this.listView.BeginUpdate();
473- this.virtualListView.Clear();
474-
473+
475474 if (this.currentPath == "") {
475+ this.virtualListView.Clear();
476476 System.IO.DriveInfo[] drives = System.IO.DriveInfo.GetDrives();
477477
478478 foreach (System.IO.DriveInfo info in drives) {
@@ -493,6 +493,20 @@
493493 int hiddenFileNum = 0;
494494 int hiddenFolderNum = 0;
495495
496+ bool isReuseImage = false;
497+ List<VirtualListViewItem> oldItems = new List<VirtualListViewItem>();
498+ if (this.previousPath == this.currentPath) {
499+ isReuseImage = true;
500+ foreach (VirtualListViewItem item in this.virtualListView.Items) {
501+ oldItems.Add(item);
502+ }
503+ } else {
504+ this.listView.SmallImageList.Images.Clear();
505+ this.listView.LargeImageList.Images.Clear();
506+ }
507+
508+ this.virtualListView.Clear();
509+
496510 //アクセス権がないかもしれないので、最初(消す前)に取得を試みる
497511 String[] folders;
498512 try {
@@ -572,6 +586,24 @@
572586 SetFocusAndSelected(this.virtualListView.Items[0].FilerItem.FullName);
573587 }
574588
589+ if (isReuseImage) {
590+ foreach (VirtualListViewItem newItem in this.virtualListView.Items) {
591+ foreach (VirtualListViewItem oldItem in oldItems) {
592+ if (newItem.Equals(oldItem)) {
593+ if (this.listView.View == View.LargeIcon) {
594+ newItem.Item.ImageIndex = oldItem.Item.ImageIndex;
595+ }
596+ break;
597+ }
598+ }
599+ //見つからなかった場合
600+ if (newItem.Item.ImageIndex == -1) {
601+ this.listView.LargeImageList.Images.Add(newItem.FilerItem.ThumnailImage);
602+ newItem.Item.ImageIndex = this.listView.LargeImageList.Images.Count - 1;
603+ }
604+ }
605+ }
606+
575607 //パネルなどの表示
576608 currentPathText.Text = currentPath;
577609 System.IO.DriveInfo driveInfo = new System.IO.DriveInfo(currentPath.Substring(0, 1));
--- SCFiler2/MoveDialog.cs (revision 93)
+++ SCFiler2/MoveDialog.cs (revision 94)
@@ -58,7 +58,6 @@
5858 ViewInterfaces.CheckUpdateAllView();
5959 activeView.UpdateView();
6060 activeView.SelectMode = SelectMode.Normal;
61- activeView.ViewMode = ViewMode.Normal;
6261 inactiveView.UpdateView();
6362 inactiveView.SelectMode = SelectMode.Normal;
6463 inactiveView.ViewMode = ViewMode.Normal;
--- SCFiler2/CopyDialog.cs (revision 93)
+++ SCFiler2/CopyDialog.cs (revision 94)
@@ -68,7 +68,6 @@
6868 inactiveView.UpdateView();
6969 activeView.SelectMode = SelectMode.Normal;
7070 inactiveView.SelectMode = SelectMode.Normal;
71- activeView.ViewMode = ViewMode.Normal;
7271 inactiveView.ViewMode = ViewMode.Normal;
7372 break;
7473 case OperationTargetDialog.Target.Clipboard:
--- SCFiler2/About.Designer.cs (revision 93)
+++ SCFiler2/About.Designer.cs (revision 94)
@@ -35,7 +35,7 @@
3535 this.appName.Name = "appName";
3636 this.appName.Size = new System.Drawing.Size(147, 12);
3737 this.appName.TabIndex = 0;
38- this.appName.Text = "SCFiler2 Alpha version 0.39";
38+ this.appName.Text = "SCFiler2 Alpha version 0.40";
3939 this.appName.Click += new System.EventHandler(this.appName_Click);
4040 //
4141 // okButton
--- SCFiler2/VirtualListViewItem.cs (revision 93)
+++ SCFiler2/VirtualListViewItem.cs (revision 94)
@@ -203,5 +203,13 @@
203203 this.viewItem.Selected = this.Selected;
204204 }
205205
206+ public override bool Equals(object obj) {
207+ if (obj == null || obj.GetType() != this.GetType()) {
208+ return false;
209+ } else {
210+ return this.FilerItem.FullName == ((VirtualListViewItem)obj).FilerItem.FullName;
211+ }
212+ }
213+
206214 }
207215 }
Show on old repository browser