Added option to remove file from list of files, so to ignore

it.
This commit is contained in:
2017-05-03 01:47:34 +01:00
parent 2a3a3a4475
commit 75ce95bab4
5 changed files with 74 additions and 8 deletions

View File

@@ -1,3 +1,12 @@
2017-05-03 Natalia Portillo <claunia@claunia.com>
* MainWindow.cs:
* gtk-gui/gui.stetic:
* gtk-gui/MainWindow.cs:
* gtk-gui/osrepodbmgr.dlgMetadata.cs:
Added option to remove file from list of files, so to ignore
it.
2017-05-03 Natalia Portillo <claunia@claunia.com>
* dlgMetadata.cs:

View File

@@ -310,7 +310,7 @@ public partial class MainWindow : Window
thdCheckFiles.Abort();
prgProgress.Visible = false;
btnStop.Visible = false;
btnClose.Visible = true;
btnClose.Visible = false;
btnExit.Sensitive = true;
Core.Failed -= ChkFilesFailed;
Core.Finished -= ChkFilesFinished;
@@ -352,6 +352,7 @@ public partial class MainWindow : Window
btnAdd.Visible = true;
btnPack.Visible = true;
btnPack.Sensitive = true;
btnRemoveFile.Visible = true;
txtFormat.IsEditable = true;
txtMachine.IsEditable = true;
@@ -452,6 +453,7 @@ public partial class MainWindow : Window
btnAdd.Visible = false;
btnPack.Visible = false;
btnClose.Visible = false;
btnRemoveFile.Visible = false;
if(fileView != null)
fileView.Clear();
if(osView != null)
@@ -1191,4 +1193,23 @@ public partial class MainWindow : Window
_dlgMetadata.Destroy();
}
protected void OnBtnRemoveFileClicked(object sender, EventArgs e)
{
TreeIter fileIter;
if(treeFiles.Selection.GetSelected(out fileIter))
{
string name = (string)fileView.GetValue(fileIter, 0);
string filesPath;
if(!string.IsNullOrEmpty(MainClass.tmpFolder) && Directory.Exists(MainClass.tmpFolder))
filesPath = MainClass.tmpFolder;
else
filesPath = MainClass.path;
MainClass.hashes.Remove(name);
MainClass.files.Remove(System.IO.Path.Combine(filesPath, name));
fileView.Remove(ref fileIter);
}
}
}

View File

@@ -119,6 +119,8 @@ public partial class MainWindow
private global::Gtk.Button btnMetadata;
private global::Gtk.Button btnRemoveFile;
protected virtual void Build()
{
global::Stetic.Gui.Initialize(this);
@@ -687,17 +689,30 @@ public partial class MainWindow
w61.Position = 9;
w61.Expand = false;
w61.Fill = false;
this.vbox1.Add(this.hbox1);
global::Gtk.Box.BoxChild w62 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.hbox1]));
w62.Position = 12;
// Container child hbox1.Gtk.Box+BoxChild
this.btnRemoveFile = new global::Gtk.Button();
this.btnRemoveFile.CanFocus = true;
this.btnRemoveFile.Name = "btnRemoveFile";
this.btnRemoveFile.UseStock = true;
this.btnRemoveFile.UseUnderline = true;
this.btnRemoveFile.Label = "gtk-remove";
this.hbox1.Add(this.btnRemoveFile);
global::Gtk.Box.BoxChild w62 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnRemoveFile]));
w62.PackType = ((global::Gtk.PackType)(1));
w62.Position = 10;
w62.Expand = false;
w62.Fill = false;
this.vbox1.Add(this.hbox1);
global::Gtk.Box.BoxChild w63 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.hbox1]));
w63.Position = 12;
w63.Expand = false;
w63.Fill = false;
this.Add(this.vbox1);
if((this.Child != null))
{
this.Child.ShowAll();
}
this.DefaultWidth = 778;
this.DefaultWidth = 857;
this.DefaultHeight = 544;
this.lblProgress.Hide();
this.prgProgress.Hide();
@@ -708,8 +723,10 @@ public partial class MainWindow
this.btnAdd.Hide();
this.btnStop.Hide();
this.btnMetadata.Hide();
this.btnRemoveFile.Hide();
this.Show();
this.DeleteEvent += new global::Gtk.DeleteEventHandler(this.OnDeleteEvent);
this.btnRemoveFile.Clicked += new global::System.EventHandler(this.OnBtnRemoveFileClicked);
this.btnMetadata.Clicked += new global::System.EventHandler(this.OnBtnMetadataClicked);
this.btnStop.Clicked += new global::System.EventHandler(this.OnBtnStopClicked);
this.btnFolder.Clicked += new global::System.EventHandler(this.OnBtnFolderClicked);

View File

@@ -7,7 +7,7 @@
<widget-library name="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<widget-library name="../bin/Debug/osrepodbmgr.exe" internal="true" />
</import>
<widget class="Gtk.Window" id="MainWindow" design-size="778 544">
<widget class="Gtk.Window" id="MainWindow" design-size="857 544">
<property name="MemberName" />
<property name="Title" translatable="yes">OS Repository DB Manager</property>
<property name="WindowPosition">CenterOnParent</property>
@@ -757,6 +757,25 @@
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Button" id="btnRemoveFile">
<property name="MemberName" />
<property name="Visible">False</property>
<property name="CanFocus">True</property>
<property name="UseStock">True</property>
<property name="Type">StockItem</property>
<property name="StockId">gtk-remove</property>
<signal name="Clicked" handler="OnBtnRemoveFileClicked" />
<property name="label">gtk-remove</property>
</widget>
<packing>
<property name="PackType">End</property>
<property name="Position">10</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="Position">12</property>
@@ -1237,7 +1256,7 @@ QNX/QNX/20090229/source.zip</property>
<widget class="Gtk.Notebook" id="notebook3">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="CurrentPage">8</property>
<property name="CurrentPage">0</property>
<child>
<widget class="Gtk.VBox" id="vbox3">
<property name="MemberName" />

View File

@@ -317,7 +317,7 @@ namespace osrepodbmgr
this.notebook3 = new global::Gtk.Notebook();
this.notebook3.CanFocus = true;
this.notebook3.Name = "notebook3";
this.notebook3.CurrentPage = 8;
this.notebook3.CurrentPage = 0;
// Container child notebook3.Gtk.Notebook+NotebookChild
this.vbox3 = new global::Gtk.VBox();
this.vbox3.Name = "vbox3";