From 78ca8578eb1274db5ba90fe50c4bf131dfa172fd Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sun, 23 Apr 2017 21:25:47 +0100 Subject: [PATCH] * osrepodbmgr/DBOps.cs: Added checking for which OSes contains chosen files. Corrected DB misscalling. * osrepodbmgr/Core.cs: * osrepodbmgr/MainWindow.cs: * osrepodbmgr/gtk-gui/gui.stetic: * osrepodbmgr/gtk-gui/generated.cs: * osrepodbmgr/gtk-gui/MainWindow.cs: Added checking for which OSes contains chosen files. --- osrepodbmgr/ChangeLog | 13 ++ osrepodbmgr/Core.cs | 117 +++++++++++++++- osrepodbmgr/DBOps.cs | 56 +++++--- osrepodbmgr/MainWindow.cs | 120 ++++++++++++++-- osrepodbmgr/gtk-gui/MainWindow.cs | 224 ++++++++++++++++++------------ osrepodbmgr/gtk-gui/generated.cs | 8 +- osrepodbmgr/gtk-gui/gui.stetic | 53 ++++++- 7 files changed, 456 insertions(+), 135 deletions(-) diff --git a/osrepodbmgr/ChangeLog b/osrepodbmgr/ChangeLog index d1ba238..6f61bb3 100644 --- a/osrepodbmgr/ChangeLog +++ b/osrepodbmgr/ChangeLog @@ -1,3 +1,16 @@ +2017-04-23 Natalia Portillo + + * DBOps.cs: + Added checking for which OSes contains chosen files. + Corrected DB misscalling. + + * Core.cs: + * MainWindow.cs: + * gtk-gui/gui.stetic: + * gtk-gui/generated.cs: + * gtk-gui/MainWindow.cs: + Added checking for which OSes contains chosen files. + 2017-04-23 Natalia Portillo * Core.cs: diff --git a/osrepodbmgr/Core.cs b/osrepodbmgr/Core.cs index 7442fec..c6189b8 100644 --- a/osrepodbmgr/Core.cs +++ b/osrepodbmgr/Core.cs @@ -45,14 +45,16 @@ namespace osrepodbmgr public delegate void FailedDelegate(string text); public delegate void FinishedWithoutErrorDelegate(); public delegate void FinishedWithTextDelegate(string text); - public delegate void AddEntryDelegate(string filename, string hash, bool known); + public delegate void AddFileDelegate(string filename, string hash, bool known); + public delegate void AddOSDelegate(DBEntry os, bool existsInRepo, string pathInRepo); public static event UpdateProgressDelegate UpdateProgress; public static event UpdateProgress2Delegate UpdateProgress2; public static event FailedDelegate Failed; public static event FinishedWithoutErrorDelegate Finished; public static event FinishedWithTextDelegate FinishedWithText; - public static event AddEntryDelegate AddEntry; + public static event AddFileDelegate AddFile; + public static event AddOSDelegate AddOS; static DBCore dbCore; @@ -184,11 +186,118 @@ namespace osrepodbmgr if(UpdateProgress != null) UpdateProgress(null, "Checking files in database", counter, MainClass.hashes.Count); - if(AddEntry != null) - AddEntry(kvp.Key, kvp.Value.Sha256, dbCore.DBOps.ExistsFile(kvp.Value.Sha256)); + if(AddFile != null) + AddFile(kvp.Key, kvp.Value.Sha256, dbCore.DBOps.ExistsFile(kvp.Value.Sha256)); counter++; } + + if(UpdateProgress != null) + UpdateProgress(null, "Retrieving OSes from database", counter, MainClass.hashes.Count); + List oses; + dbCore.DBOps.GetAllOSes(out oses); + + if(oses != null && oses.Count > 0) + { + DBEntry[] osesArray = new DBEntry[oses.Count]; + oses.CopyTo(osesArray); + + long osCounter = 0; + foreach(DBEntry os in osesArray) + { + if(UpdateProgress != null) + UpdateProgress(null, string.Format("Check OS id {0}", os.id), osCounter, osesArray.Length); + + counter = 0; + foreach(KeyValuePair kvp in MainClass.hashes) + { + if(UpdateProgress2 != null) + UpdateProgress2(null, string.Format("Checking for file {0}", kvp.Value.Path), counter, MainClass.hashes.Count); + + if(!dbCore.DBOps.ExistsFileInOS(kvp.Value.Sha256, os.id)) + { + if(oses.Contains(os)) + oses.Remove(os); + + // If one file is missing, the rest don't matter + break; + } + + counter++; + } + + if(oses.Count == 0) + break; // No OSes left + } + } + + if(AddOS != null) + { + // TODO: Check file name and existence + foreach(DBEntry os in oses) + { + string destinationFolder; + destinationFolder = Path.Combine(Settings.Current.RepositoryPath, os.developer, os.product, os.version); + if(!string.IsNullOrWhiteSpace(os.languages)) + destinationFolder = Path.Combine(destinationFolder, os.languages); + if(!string.IsNullOrWhiteSpace(os.architecture)) + destinationFolder = Path.Combine(destinationFolder, os.architecture); + if(os.oem) + destinationFolder = Path.Combine(destinationFolder, "oem"); + if(!string.IsNullOrWhiteSpace(os.machine)) + destinationFolder = Path.Combine(destinationFolder, "for " + os.machine); + + string destinationFile = ""; + if(!string.IsNullOrWhiteSpace(os.format)) + destinationFile += "[" + os.format + "]"; + if(os.files) + { + if(destinationFile != "") + destinationFile += "_"; + destinationFile += "files"; + } + if(os.netinstall) + { + if(destinationFile != "") + destinationFile += "_"; + destinationFile += "netinstall"; + } + if(os.source) + { + if(destinationFile != "") + destinationFile += "_"; + destinationFile += "source"; + } + if(os.update) + { + if(destinationFile != "") + destinationFile += "_"; + destinationFile += "update"; + } + if(os.upgrade) + { + if(destinationFile != "") + destinationFile += "_"; + destinationFile += "upgrade"; + } + if(!string.IsNullOrWhiteSpace(os.description)) + { + if(destinationFile != "") + destinationFile += "_"; + destinationFile += os.description; + } + else if(destinationFile == "") + { + destinationFile = "archive"; + } + + string destination = Path.Combine(destinationFolder, destinationFile) + ".zip"; + + if(AddOS != null) + AddOS(os, File.Exists(destination), destination); + } + } + if(Finished != null) Finished(); } diff --git a/osrepodbmgr/DBOps.cs b/osrepodbmgr/DBOps.cs index a9bfcdb..1a5f914 100644 --- a/osrepodbmgr/DBOps.cs +++ b/osrepodbmgr/DBOps.cs @@ -34,7 +34,7 @@ namespace osrepodbmgr { public struct DBEntry { - public ulong id; + public long id; public string developer; public string product; public string version; @@ -91,21 +91,21 @@ namespace osrepodbmgr foreach(DataRow dRow in dataTable.Rows) { DBEntry fEntry = new DBEntry(); - fEntry.id = ulong.Parse(dRow["id"].ToString()); - fEntry.developer = dRow["name"].ToString(); - fEntry.product = dRow["founded"].ToString(); - fEntry.version = dRow["website"].ToString(); - fEntry.languages = dRow["twitter"].ToString(); - fEntry.architecture = dRow["facebook"].ToString(); - fEntry.machine = dRow["sold"].ToString(); - fEntry.format = dRow["sold_to"].ToString(); - fEntry.description = dRow["address"].ToString(); - fEntry.oem = bool.Parse(dRow["city"].ToString()); - fEntry.upgrade = bool.Parse(dRow["province"].ToString()); - fEntry.update = bool.Parse(dRow["postal_code"].ToString()); - fEntry.source = bool.Parse(dRow["country"].ToString()); - fEntry.files = bool.Parse(dRow["city"].ToString()); - fEntry.netinstall = bool.Parse(dRow["city"].ToString()); + fEntry.id = long.Parse(dRow["id"].ToString()); + fEntry.developer = dRow["developer"].ToString(); + fEntry.product = dRow["product"].ToString(); + fEntry.version = dRow["version"].ToString(); + fEntry.languages = dRow["languages"].ToString(); + fEntry.architecture = dRow["architecture"].ToString(); + fEntry.machine = dRow["machine"].ToString(); + fEntry.format = dRow["format"].ToString(); + fEntry.description = dRow["description"].ToString(); + fEntry.oem = bool.Parse(dRow["oem"].ToString()); + fEntry.upgrade = bool.Parse(dRow["upgrade"].ToString()); + fEntry.update = bool.Parse(dRow["update"].ToString()); + fEntry.source = bool.Parse(dRow["source"].ToString()); + fEntry.files = bool.Parse(dRow["files"].ToString()); + fEntry.netinstall = bool.Parse(dRow["netinstall"].ToString()); entries.Add(fEntry); } @@ -358,6 +358,30 @@ namespace osrepodbmgr return true; } + + public bool ExistsFileInOS(string hash, long osId) + { + IDbCommand dbcmd = dbCon.CreateCommand(); + IDbDataParameter param1 = dbcmd.CreateParameter(); + + param1.ParameterName = "@hash"; + param1.DbType = DbType.String; + param1.Value = hash; + dbcmd.Parameters.Add(param1); + dbcmd.CommandText = string.Format("SELECT * FROM `os_{0}` WHERE sha256 = @hash", osId); + DataSet dataSet = new DataSet(); + IDbDataAdapter dataAdapter = dbCore.GetNewDataAdapter(); + dataAdapter.SelectCommand = dbcmd; + dataAdapter.Fill(dataSet); + DataTable dataTable = dataSet.Tables[0]; + + foreach(DataRow dRow in dataTable.Rows) + { + return true; + } + + return false; + } } } diff --git a/osrepodbmgr/MainWindow.cs b/osrepodbmgr/MainWindow.cs index 78d8e19..cc4c7b3 100644 --- a/osrepodbmgr/MainWindow.cs +++ b/osrepodbmgr/MainWindow.cs @@ -43,7 +43,8 @@ public partial class MainWindow : Window Thread thdExtractArchive; Thread thdRemoveTemp; bool stopped; - ListStore view; + ListStore fileView; + ListStore osView; public MainWindow() : base(WindowType.Toplevel) { @@ -62,12 +63,66 @@ public partial class MainWindow : Window TreeViewColumn hashColumn = new TreeViewColumn("SHA256", hashCell, "text", 1, "background", 3, "foreground", 4); TreeViewColumn dbColumn = new TreeViewColumn("Known?", dbCell, "active", 2); - view = new ListStore(typeof(string), typeof(string), typeof(bool), typeof(string), typeof(string)); + fileView = new ListStore(typeof(string), typeof(string), typeof(bool), typeof(string), typeof(string)); - treeFiles.Model = view; + treeFiles.Model = fileView; treeFiles.AppendColumn(filenameColumn); treeFiles.AppendColumn(hashColumn); treeFiles.AppendColumn(dbColumn); + + tabTabs.GetNthPage(1).Visible = false; + + CellRendererText developerCell = new CellRendererText(); + CellRendererText productCell = new CellRendererText(); + CellRendererText versionCell = new CellRendererText(); + CellRendererText languagesCell = new CellRendererText(); + CellRendererText architectureCell = new CellRendererText(); + CellRendererText machineCell = new CellRendererText(); + CellRendererText formatCell = new CellRendererText(); + CellRendererText descriptionCell = new CellRendererText(); + CellRendererToggle oemCell = new CellRendererToggle(); + CellRendererToggle upgradeCell = new CellRendererToggle(); + CellRendererToggle updateCell = new CellRendererToggle(); + CellRendererToggle sourceCell = new CellRendererToggle(); + CellRendererToggle filesCell = new CellRendererToggle(); + CellRendererToggle netinstallCell = new CellRendererToggle(); + CellRendererText pathCell = new CellRendererText(); + + TreeViewColumn developerColumn = new TreeViewColumn("Developer", developerCell, "text", 0, "background", 14, "foreground", 15); + TreeViewColumn productColumn = new TreeViewColumn("Product", productCell, "text", 1, "background", 14, "foreground", 15); + TreeViewColumn versionColumn = new TreeViewColumn("Version", versionCell, "text", 2, "background", 14, "foreground", 15); + TreeViewColumn languagesColumn = new TreeViewColumn("Languages", languagesCell, "text", 3, "background", 14, "foreground", 15); + TreeViewColumn architectureColumn = new TreeViewColumn("Architecture", architectureCell, "text", 4, "background", 14, "foreground", 15); + TreeViewColumn machineColumn = new TreeViewColumn("Machine", machineCell, "text", 5, "background", 14, "foreground", 15); + TreeViewColumn formatColumn = new TreeViewColumn("Format", formatCell, "text", 6, "background", 14, "foreground", 15); + TreeViewColumn descriptionColumn = new TreeViewColumn("Description", descriptionCell, "text", 7, "background", 14, "foreground", 15); + TreeViewColumn oemColumn = new TreeViewColumn("OEM?", oemCell, "active", 8); + TreeViewColumn upgradeColumn = new TreeViewColumn("Upgrade?", upgradeCell, "active", 9); + TreeViewColumn updateColumn = new TreeViewColumn("Update?", updateCell, "active", 10); + TreeViewColumn sourceColumn = new TreeViewColumn("Source?", sourceCell, "active", 11); + TreeViewColumn filesColumn = new TreeViewColumn("Files?", filesCell, "active", 12); + TreeViewColumn netinstallColumn = new TreeViewColumn("NetInstall?", netinstallCell, "active", 13); + TreeViewColumn pathColumn = new TreeViewColumn("Path in repo", pathCell, "text", 16, "background", 14, "foreground", 15); + + osView = new ListStore(typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), + typeof(bool), typeof(bool), typeof(bool), typeof(bool), typeof(bool), typeof(bool), typeof(string), typeof(string), typeof(string)); + + treeOSes.Model = osView; + treeOSes.AppendColumn(developerColumn); + treeOSes.AppendColumn(productColumn); + treeOSes.AppendColumn(versionColumn); + treeOSes.AppendColumn(languagesColumn); + treeOSes.AppendColumn(architectureColumn); + treeOSes.AppendColumn(machineColumn); + treeOSes.AppendColumn(formatColumn); + treeOSes.AppendColumn(descriptionColumn); + treeOSes.AppendColumn(oemColumn); + treeOSes.AppendColumn(upgradeColumn); + treeOSes.AppendColumn(updateColumn); + treeOSes.AppendColumn(sourceColumn); + treeOSes.AppendColumn(filesColumn); + treeOSes.AppendColumn(netinstallColumn); + treeOSes.AppendColumn(pathColumn); } void UnarChangeStatus() @@ -229,7 +284,9 @@ public partial class MainWindow : Window Core.Failed += ChkFilesFailed; Core.Finished += ChkFilesFinished; Core.UpdateProgress += UpdateProgress; - Core.AddEntry += AddFile; + Core.UpdateProgress2 += UpdateProgress2; + Core.AddFile += AddFile; + Core.AddOS += AddOS; btnAdd.Sensitive = false; thdCheckFiles.Start(); }); @@ -254,10 +311,17 @@ public partial class MainWindow : Window Core.Failed -= ChkFilesFailed; Core.Finished -= ChkFilesFinished; Core.UpdateProgress -= UpdateProgress; - Core.AddEntry -= AddFile; + Core.UpdateProgress2 -= UpdateProgress2; + Core.AddFile -= AddFile; + Core.AddOS -= AddOS; thdHashFiles = null; - if(view != null) - view.Clear(); + if(fileView != null) + fileView.Clear(); + if(osView != null) + { + tabTabs.GetNthPage(1).Visible = false; + osView.Clear(); + } }); } @@ -271,7 +335,9 @@ public partial class MainWindow : Window Core.Failed -= ChkFilesFailed; Core.Finished -= ChkFilesFinished; Core.UpdateProgress -= UpdateProgress; - Core.AddEntry -= AddFile; + Core.UpdateProgress2 -= UpdateProgress2; + Core.AddFile -= AddFile; + Core.AddOS -= AddOS; thdHashFiles = null; prgProgress.Visible = false; @@ -305,11 +371,23 @@ public partial class MainWindow : Window Application.Invoke(delegate { string color = known ? "green" : "red"; - view.AppendValues(filename, hash, known, color, "black"); + fileView.AppendValues(filename, hash, known, color, "black"); btnAdd.Sensitive |= !known; }); } + void AddOS(DBEntry os, bool existsInRepo, string pathInRepo) + { + Application.Invoke(delegate + { + string color = existsInRepo ? "green" : "red"; + tabTabs.GetNthPage(1).Visible = true; + osView.AppendValues(os.developer, os.product, os.version, os.languages, os.architecture, os.machine, + os.format, os.description, os.oem, os.upgrade, os.update, os.source, + os.files, os.netinstall, color, "black", pathInRepo); + }); + } + protected void OnBtnExitClicked(object sender, EventArgs e) { if(btnClose.Sensitive) @@ -329,8 +407,13 @@ public partial class MainWindow : Window btnAdd.Visible = false; btnPack.Visible = false; btnClose.Visible = false; - if(view != null) - view.Clear(); + if(fileView != null) + fileView.Clear(); + if(osView != null) + { + tabTabs.GetNthPage(1).Visible = false; + osView.Clear(); + } txtFormat.IsEditable = false; txtMachine.IsEditable = false; txtProduct.IsEditable = false; @@ -514,8 +597,13 @@ public partial class MainWindow : Window Core.UpdateProgress -= UpdateProgress; Core.UpdateProgress2 -= UpdateProgress2; btnStop.Visible = false; - if(view != null) - view.Clear(); + if(fileView != null) + fileView.Clear(); + if(osView != null) + { + tabTabs.GetNthPage(1).Visible = false; + osView.Clear(); + } } public void RemoveTempFilesFailed(string text) @@ -611,14 +699,16 @@ public partial class MainWindow : Window Core.Failed -= AddFilesToDbFailed; long counter = 0; - view.Clear(); + fileView.Clear(); foreach(KeyValuePair kvp in MainClass.hashes) { UpdateProgress(null, "Updating table", counter, MainClass.hashes.Count); - view.AppendValues(kvp.Key, kvp.Value.Path, true, "green", "black"); + fileView.AppendValues(kvp.Key, kvp.Value.Path, true, "green", "black"); counter++; } + // TODO: Update OS table + prgProgress.Visible = false; btnPack.Sensitive = true; btnClose.Sensitive = true; diff --git a/osrepodbmgr/gtk-gui/MainWindow.cs b/osrepodbmgr/gtk-gui/MainWindow.cs index 8bfb0ac..cce320e 100644 --- a/osrepodbmgr/gtk-gui/MainWindow.cs +++ b/osrepodbmgr/gtk-gui/MainWindow.cs @@ -71,10 +71,20 @@ public partial class MainWindow private global::Gtk.CheckButton chkNetinstall; + private global::Gtk.Notebook tabTabs; + private global::Gtk.ScrolledWindow GtkScrolledWindow; private global::Gtk.TreeView treeFiles; + private global::Gtk.Label lblTabFiles; + + private global::Gtk.ScrolledWindow GtkScrolledWindow1; + + private global::Gtk.TreeView treeOSes; + + private global::Gtk.Label lblTabOSes; + private global::Gtk.HBox hbox2; private global::Gtk.Label lblProgress; @@ -436,6 +446,11 @@ public partial class MainWindow w33.Expand = false; w33.Fill = false; // Container child vbox1.Gtk.Box+BoxChild + this.tabTabs = new global::Gtk.Notebook(); + this.tabTabs.CanFocus = true; + this.tabTabs.Name = "tabTabs"; + this.tabTabs.CurrentPage = 0; + // Container child tabTabs.Gtk.Notebook+NotebookChild this.GtkScrolledWindow = new global::Gtk.ScrolledWindow(); this.GtkScrolledWindow.Name = "GtkScrolledWindow"; this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1)); @@ -443,10 +458,37 @@ public partial class MainWindow this.treeFiles = new global::Gtk.TreeView(); this.treeFiles.CanFocus = true; this.treeFiles.Name = "treeFiles"; + this.treeFiles.Reorderable = true; this.GtkScrolledWindow.Add(this.treeFiles); - this.vbox1.Add(this.GtkScrolledWindow); - global::Gtk.Box.BoxChild w35 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.GtkScrolledWindow])); - w35.Position = 9; + this.tabTabs.Add(this.GtkScrolledWindow); + // Notebook tab + this.lblTabFiles = new global::Gtk.Label(); + this.lblTabFiles.Name = "lblTabFiles"; + this.lblTabFiles.LabelProp = global::Mono.Unix.Catalog.GetString("Files"); + this.tabTabs.SetTabLabel(this.GtkScrolledWindow, this.lblTabFiles); + this.lblTabFiles.ShowAll(); + // Container child tabTabs.Gtk.Notebook+NotebookChild + this.GtkScrolledWindow1 = new global::Gtk.ScrolledWindow(); + this.GtkScrolledWindow1.Name = "GtkScrolledWindow1"; + this.GtkScrolledWindow1.ShadowType = ((global::Gtk.ShadowType)(1)); + // Container child GtkScrolledWindow1.Gtk.Container+ContainerChild + this.treeOSes = new global::Gtk.TreeView(); + this.treeOSes.CanFocus = true; + this.treeOSes.Name = "treeOSes"; + this.treeOSes.Reorderable = true; + this.GtkScrolledWindow1.Add(this.treeOSes); + this.tabTabs.Add(this.GtkScrolledWindow1); + global::Gtk.Notebook.NotebookChild w37 = ((global::Gtk.Notebook.NotebookChild)(this.tabTabs[this.GtkScrolledWindow1])); + w37.Position = 1; + // Notebook tab + this.lblTabOSes = new global::Gtk.Label(); + this.lblTabOSes.Name = "lblTabOSes"; + this.lblTabOSes.LabelProp = global::Mono.Unix.Catalog.GetString("OSes"); + this.tabTabs.SetTabLabel(this.GtkScrolledWindow1, this.lblTabOSes); + this.lblTabOSes.ShowAll(); + this.vbox1.Add(this.tabTabs); + global::Gtk.Box.BoxChild w38 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.tabTabs])); + w38.Position = 9; // Container child vbox1.Gtk.Box+BoxChild this.hbox2 = new global::Gtk.HBox(); this.hbox2.Name = "hbox2"; @@ -456,21 +498,21 @@ public partial class MainWindow this.lblProgress.Name = "lblProgress"; this.lblProgress.LabelProp = global::Mono.Unix.Catalog.GetString("label2"); this.hbox2.Add(this.lblProgress); - global::Gtk.Box.BoxChild w36 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.lblProgress])); - w36.Position = 0; - w36.Expand = false; - w36.Fill = false; + global::Gtk.Box.BoxChild w39 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.lblProgress])); + w39.Position = 0; + w39.Expand = false; + w39.Fill = false; // Container child hbox2.Gtk.Box+BoxChild this.prgProgress = new global::Gtk.ProgressBar(); this.prgProgress.Name = "prgProgress"; this.hbox2.Add(this.prgProgress); - global::Gtk.Box.BoxChild w37 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.prgProgress])); - w37.Position = 1; + global::Gtk.Box.BoxChild w40 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.prgProgress])); + w40.Position = 1; this.vbox1.Add(this.hbox2); - global::Gtk.Box.BoxChild w38 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.hbox2])); - w38.Position = 10; - w38.Expand = false; - w38.Fill = false; + global::Gtk.Box.BoxChild w41 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.hbox2])); + w41.Position = 10; + w41.Expand = false; + w41.Fill = false; // Container child vbox1.Gtk.Box+BoxChild this.hbox27 = new global::Gtk.HBox(); this.hbox27.Name = "hbox27"; @@ -480,21 +522,21 @@ public partial class MainWindow this.lblProgress2.Name = "lblProgress2"; this.lblProgress2.LabelProp = global::Mono.Unix.Catalog.GetString("label22"); this.hbox27.Add(this.lblProgress2); - global::Gtk.Box.BoxChild w39 = ((global::Gtk.Box.BoxChild)(this.hbox27[this.lblProgress2])); - w39.Position = 0; - w39.Expand = false; - w39.Fill = false; + global::Gtk.Box.BoxChild w42 = ((global::Gtk.Box.BoxChild)(this.hbox27[this.lblProgress2])); + w42.Position = 0; + w42.Expand = false; + w42.Fill = false; // Container child hbox27.Gtk.Box+BoxChild this.prgProgress2 = new global::Gtk.ProgressBar(); this.prgProgress2.Name = "prgProgress2"; this.hbox27.Add(this.prgProgress2); - global::Gtk.Box.BoxChild w40 = ((global::Gtk.Box.BoxChild)(this.hbox27[this.prgProgress2])); - w40.Position = 1; + global::Gtk.Box.BoxChild w43 = ((global::Gtk.Box.BoxChild)(this.hbox27[this.prgProgress2])); + w43.Position = 1; this.vbox1.Add(this.hbox27); - global::Gtk.Box.BoxChild w41 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.hbox27])); - w41.Position = 11; - w41.Expand = false; - w41.Fill = false; + global::Gtk.Box.BoxChild w44 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.hbox27])); + w44.Position = 11; + w44.Expand = false; + w44.Fill = false; // Container child vbox1.Gtk.Box+BoxChild this.hbox1 = new global::Gtk.HBox(); this.hbox1.Name = "hbox1"; @@ -507,26 +549,26 @@ public partial class MainWindow this.btnExit.UseUnderline = true; this.btnExit.Label = "gtk-quit"; this.hbox1.Add(this.btnExit); - global::Gtk.Box.BoxChild w42 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnExit])); - w42.PackType = ((global::Gtk.PackType)(1)); - w42.Position = 0; - w42.Expand = false; - w42.Fill = false; + global::Gtk.Box.BoxChild w45 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnExit])); + w45.PackType = ((global::Gtk.PackType)(1)); + w45.Position = 0; + w45.Expand = false; + w45.Fill = false; // Container child hbox1.Gtk.Box+BoxChild this.btnSettings = new global::Gtk.Button(); this.btnSettings.CanFocus = true; this.btnSettings.Name = "btnSettings"; this.btnSettings.UseUnderline = true; this.btnSettings.Label = global::Mono.Unix.Catalog.GetString("_Settings"); - global::Gtk.Image w43 = new global::Gtk.Image(); - w43.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-preferences", global::Gtk.IconSize.Menu); - this.btnSettings.Image = w43; + global::Gtk.Image w46 = new global::Gtk.Image(); + w46.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-preferences", global::Gtk.IconSize.Menu); + this.btnSettings.Image = w46; this.hbox1.Add(this.btnSettings); - global::Gtk.Box.BoxChild w44 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnSettings])); - w44.PackType = ((global::Gtk.PackType)(1)); - w44.Position = 1; - w44.Expand = false; - w44.Fill = false; + global::Gtk.Box.BoxChild w47 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnSettings])); + w47.PackType = ((global::Gtk.PackType)(1)); + w47.Position = 1; + w47.Expand = false; + w47.Fill = false; // Container child hbox1.Gtk.Box+BoxChild this.btnHelp = new global::Gtk.Button(); this.btnHelp.CanFocus = true; @@ -535,86 +577,86 @@ public partial class MainWindow this.btnHelp.UseUnderline = true; this.btnHelp.Label = "gtk-help"; this.hbox1.Add(this.btnHelp); - global::Gtk.Box.BoxChild w45 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnHelp])); - w45.PackType = ((global::Gtk.PackType)(1)); - w45.Position = 2; - w45.Expand = false; - w45.Fill = false; + global::Gtk.Box.BoxChild w48 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnHelp])); + w48.PackType = ((global::Gtk.PackType)(1)); + w48.Position = 2; + w48.Expand = false; + w48.Fill = false; // Container child hbox1.Gtk.Box+BoxChild this.btnClose = new global::Gtk.Button(); this.btnClose.CanFocus = true; this.btnClose.Name = "btnClose"; this.btnClose.UseUnderline = true; this.btnClose.Label = global::Mono.Unix.Catalog.GetString("_Close"); - global::Gtk.Image w46 = new global::Gtk.Image(); - w46.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-close", global::Gtk.IconSize.Menu); - this.btnClose.Image = w46; + global::Gtk.Image w49 = new global::Gtk.Image(); + w49.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-close", global::Gtk.IconSize.Menu); + this.btnClose.Image = w49; this.hbox1.Add(this.btnClose); - global::Gtk.Box.BoxChild w47 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnClose])); - w47.PackType = ((global::Gtk.PackType)(1)); - w47.Position = 3; - w47.Expand = false; - w47.Fill = false; + global::Gtk.Box.BoxChild w50 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnClose])); + w50.PackType = ((global::Gtk.PackType)(1)); + w50.Position = 3; + w50.Expand = false; + w50.Fill = false; // Container child hbox1.Gtk.Box+BoxChild this.btnPack = new global::Gtk.Button(); this.btnPack.CanFocus = true; this.btnPack.Name = "btnPack"; this.btnPack.UseUnderline = true; this.btnPack.Label = global::Mono.Unix.Catalog.GetString("_Pack..."); - global::Gtk.Image w48 = new global::Gtk.Image(); - w48.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-save", global::Gtk.IconSize.Menu); - this.btnPack.Image = w48; + global::Gtk.Image w51 = new global::Gtk.Image(); + w51.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-save", global::Gtk.IconSize.Menu); + this.btnPack.Image = w51; this.hbox1.Add(this.btnPack); - global::Gtk.Box.BoxChild w49 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnPack])); - w49.PackType = ((global::Gtk.PackType)(1)); - w49.Position = 4; - w49.Expand = false; - w49.Fill = false; + global::Gtk.Box.BoxChild w52 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnPack])); + w52.PackType = ((global::Gtk.PackType)(1)); + w52.Position = 4; + w52.Expand = false; + w52.Fill = false; // Container child hbox1.Gtk.Box+BoxChild this.btnAdd = new global::Gtk.Button(); this.btnAdd.CanFocus = true; this.btnAdd.Name = "btnAdd"; this.btnAdd.UseUnderline = true; this.btnAdd.Label = global::Mono.Unix.Catalog.GetString("Add to _DB"); - global::Gtk.Image w50 = new global::Gtk.Image(); - w50.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-add", global::Gtk.IconSize.Menu); - this.btnAdd.Image = w50; + global::Gtk.Image w53 = new global::Gtk.Image(); + w53.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-add", global::Gtk.IconSize.Menu); + this.btnAdd.Image = w53; this.hbox1.Add(this.btnAdd); - global::Gtk.Box.BoxChild w51 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnAdd])); - w51.PackType = ((global::Gtk.PackType)(1)); - w51.Position = 5; - w51.Expand = false; - w51.Fill = false; + global::Gtk.Box.BoxChild w54 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnAdd])); + w54.PackType = ((global::Gtk.PackType)(1)); + w54.Position = 5; + w54.Expand = false; + w54.Fill = false; // Container child hbox1.Gtk.Box+BoxChild this.btnArchive = new global::Gtk.Button(); this.btnArchive.CanFocus = true; this.btnArchive.Name = "btnArchive"; this.btnArchive.UseUnderline = true; this.btnArchive.Label = global::Mono.Unix.Catalog.GetString("Open _archive"); - global::Gtk.Image w52 = new global::Gtk.Image(); - w52.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-open", global::Gtk.IconSize.Menu); - this.btnArchive.Image = w52; + global::Gtk.Image w55 = new global::Gtk.Image(); + w55.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-open", global::Gtk.IconSize.Menu); + this.btnArchive.Image = w55; this.hbox1.Add(this.btnArchive); - global::Gtk.Box.BoxChild w53 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnArchive])); - w53.PackType = ((global::Gtk.PackType)(1)); - w53.Position = 6; - w53.Expand = false; - w53.Fill = false; + global::Gtk.Box.BoxChild w56 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnArchive])); + w56.PackType = ((global::Gtk.PackType)(1)); + w56.Position = 6; + w56.Expand = false; + w56.Fill = false; // Container child hbox1.Gtk.Box+BoxChild this.btnFolder = new global::Gtk.Button(); this.btnFolder.CanFocus = true; this.btnFolder.Name = "btnFolder"; this.btnFolder.UseUnderline = true; this.btnFolder.Label = global::Mono.Unix.Catalog.GetString("Open _folder"); - global::Gtk.Image w54 = new global::Gtk.Image(); - w54.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-open", global::Gtk.IconSize.Menu); - this.btnFolder.Image = w54; + global::Gtk.Image w57 = new global::Gtk.Image(); + w57.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-open", global::Gtk.IconSize.Menu); + this.btnFolder.Image = w57; this.hbox1.Add(this.btnFolder); - global::Gtk.Box.BoxChild w55 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnFolder])); - w55.PackType = ((global::Gtk.PackType)(1)); - w55.Position = 7; - w55.Expand = false; - w55.Fill = false; + global::Gtk.Box.BoxChild w58 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnFolder])); + w58.PackType = ((global::Gtk.PackType)(1)); + w58.Position = 7; + w58.Expand = false; + w58.Fill = false; // Container child hbox1.Gtk.Box+BoxChild this.btnStop = new global::Gtk.Button(); this.btnStop.CanFocus = true; @@ -623,18 +665,18 @@ public partial class MainWindow this.btnStop.UseUnderline = true; this.btnStop.Label = "gtk-stop"; this.hbox1.Add(this.btnStop); - global::Gtk.Box.BoxChild w56 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnStop])); - w56.PackType = ((global::Gtk.PackType)(1)); - w56.Position = 8; - w56.Expand = false; - w56.Fill = false; + global::Gtk.Box.BoxChild w59 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnStop])); + w59.PackType = ((global::Gtk.PackType)(1)); + w59.Position = 8; + w59.Expand = false; + w59.Fill = false; this.vbox1.Add(this.hbox1); - global::Gtk.Box.BoxChild w57 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.hbox1])); - w57.Position = 12; - w57.Expand = false; - w57.Fill = false; + global::Gtk.Box.BoxChild w60 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.hbox1])); + w60.Position = 12; + w60.Expand = false; + w60.Fill = false; this.Add(this.vbox1); - if((this.Child != null)) + if ((this.Child != null)) { this.Child.ShowAll(); } diff --git a/osrepodbmgr/gtk-gui/generated.cs b/osrepodbmgr/gtk-gui/generated.cs index f916e7a..50283a9 100644 --- a/osrepodbmgr/gtk-gui/generated.cs +++ b/osrepodbmgr/gtk-gui/generated.cs @@ -8,7 +8,7 @@ namespace Stetic internal static void Initialize(Gtk.Widget iconRenderer) { - if((Stetic.Gui.initialized == false)) + if ((Stetic.Gui.initialized == false)) { Stetic.Gui.initialized = true; } @@ -20,7 +20,7 @@ namespace Stetic public static Gdk.Pixbuf LoadIcon(Gtk.Widget widget, string name, Gtk.IconSize size) { Gdk.Pixbuf res = widget.RenderIcon(name, size, null); - if((res != null)) + if ((res != null)) { return res; } @@ -32,9 +32,9 @@ namespace Stetic { return Gtk.IconTheme.Default.LoadIcon(name, sz, 0); } - catch(System.Exception) + catch (System.Exception) { - if((name != "gtk-missing-image")) + if ((name != "gtk-missing-image")) { return Stetic.IconLoader.LoadIcon(widget, "gtk-missing-image", size); } diff --git a/osrepodbmgr/gtk-gui/gui.stetic b/osrepodbmgr/gtk-gui/gui.stetic index a6828c3..4769ed2 100644 --- a/osrepodbmgr/gtk-gui/gui.stetic +++ b/osrepodbmgr/gtk-gui/gui.stetic @@ -439,16 +439,59 @@ - + - In + True + 0 - + - True - True + In + + + + True + True + True + + + + + + Files + + + tab + + + + + + In + + + + True + True + True + + + + + 1 + + + + + + OSes + + + tab + + 9