Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added support for fetching legal values for lists

  • Loading branch information...
commit 1e01f575f9c1002846dc8dd8f8ad1adecc6ba660 1 parent e35314d
Anirudh Sanjeev authored
View
4 BugzillaInterface/BugService.cs
@@ -172,7 +172,7 @@ public struct SearchParams
public string platform{get;set;}
[XmlRpcMissingMapping(MappingAction.Ignore)]
- public string priority{get;set;}
+ public string[] priority{get;set;}
[XmlRpcMissingMapping(MappingAction.Ignore)]
public string product{get;set;}
@@ -181,7 +181,7 @@ public struct SearchParams
public string reporter{get;set;}
[XmlRpcMissingMapping(MappingAction.Ignore)]
- public string resolution{get;set;}
+ public string[] resolution{get;set;}
[XmlRpcMissingMapping(MappingAction.Ignore)]
public string[] severity{get;set;}
View
6 BugzillaInterface/BugzillaInterface.csproj
@@ -44,6 +44,12 @@
<Compile Include="QueryGUI\IFilterWidget.cs" />
<Compile Include="QueryGUI\ProductFilterWidget.cs" />
<Compile Include="gtk-gui\BugzillaInterface.ProductFilterWidget.cs" />
+ <Compile Include="QueryGUI\StringArrayWidget.cs" />
+ <Compile Include="gtk-gui\BugzillaInterface.StringArrayWidget.cs" />
+ <Compile Include="QueryGUI\StatusFilterWidget.cs" />
+ <Compile Include="gtk-gui\BugzillaInterface.StatusFilterWidget.cs" />
+ <Compile Include="QueryGUI\ImportanceWidget.cs" />
+ <Compile Include="gtk-gui\BugzillaInterface.ImportanceWidget.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="CookComputing.XmlRpcV2, Version=2.4.0.0, Culture=neutral, PublicKeyToken=a7d6e17aa302004d">
View
1  BugzillaInterface/QueryGUI/IFilterWidget.cs
@@ -34,5 +34,6 @@ namespace BugzillaInterface
public interface IFilterWidget
{
void SetFilterParams(ref SearchParams filter);
+ void SetNewSourceID(int sourceID);
}
}
View
5 BugzillaInterface/QueryGUI/PeopleFilterWidget.cs
@@ -56,5 +56,10 @@ public void SetFilterParams(ref SearchParams filter)
filter.qa_contact = reportedTextBox.Text;
}
}
+
+ public void SetNewSourceID(int sourceID)
+ {
+
+ }
}
}
View
5 BugzillaInterface/QueryGUI/ProductFilterWidget.cs
@@ -48,6 +48,11 @@ public void SetFilterParams (ref SearchParams filter)
}
}
+ public void SetNewSourceID(int sourceID)
+ {
+
+ }
+
#endregion
public ProductFilterWidget ()
{
View
22 BugzillaInterface/Repository.cs
@@ -70,6 +70,18 @@ public class Repository
private set;
}
+ public List<string> componentList{get;set;}
+ public List<string> platformList{get;set;}
+ public List<string> productList{get;set;}
+ public List<string> resolutionList{get;set;}
+ public List<string> severityList{get;set;}
+ public List<string> statusList{get;set;}
+ public List<string> milestoneList{get;set;}
+ public List<string> versionList{get;set;}
+ public List<string> priorityList{get;set;}
+ //public List<string> versionList{get;set;}
+ //public List<string> versionList{get;set;}
+
public Repository ()
{
// This should be done in case it's deserialized
@@ -94,6 +106,16 @@ public bool LoginAndVerify()
return false;
}
+ public void FetchLegalValues()
+ {
+ //platformList = User.GetLegalValues("platform");
+ resolutionList = User.GetLegalValues("resolution");
+ severityList = User.GetLegalValues("severity");
+ statusList = User.GetLegalValues("status");
+ priorityList = User.GetLegalValues("priority");
+
+ }
+
public IXmlRpcProxy ConfigureXmlRpcProxy(IXmlRpcProxy proxy)
{
proxy.Url = this.Url;
View
11 BugzillaInterface/SplatterCore.cs
@@ -74,13 +74,14 @@ public void TestStuff ()
source.UserName = "anirudh@anirudhsanjeev.org";
source.Password = "opeth";
// not my real password, don't worry
- source.Proxy = "http://144.16.192.247:8080";
+ source.Proxy = "http://10.3.100.211:8080";
if (source.LoginAndVerify ()) {
+ source.FetchLegalValues();
Sources.Add(source);
- Query q1 = new Query();
- Queries.Add(q1);
- q1.SourceID = 0;
- q1.TestStuff();
+ //Query q1 = new Query();
+ //Queries.Add(q1);
+ //q1.SourceID = 0;
+ //q1.TestStuff();
SaveState();
}
}
View
30 BugzillaInterface/UserService.cs
@@ -30,6 +30,7 @@
using System.Net;
using System.Xml.Serialization;
using System.Collections.Generic;
+using System.Threading;
@@ -40,6 +41,14 @@ interface IUserAPI : IXmlRpcProxy
{
[XmlRpcMethod("User.login")]
XmlRpcStruct Login(LoginParams parameters);
+
+ [XmlRpcMethod("Bug.legal_values")]
+ LegalValuesResponse LegalValues(XmlRpcStruct parameters);
+ }
+
+ public struct LegalValuesResponse
+ {
+ public string[] values;
}
public struct LoginParams
@@ -95,6 +104,27 @@ public UserService()
{
}
+ public List<string> GetLegalValues(string fieldName)
+ {
+ XmlRpcStruct parameters = new XmlRpcStruct();
+ parameters.Add("field", fieldName);
+ //userProxy.Expect100Continue = true;
+ //userProxy.EnableCompression = false;
+
+ Console.WriteLine ("Retrieving legal values for " + fieldName);
+ LegalValuesResponse response = userProxy.LegalValues(parameters);
+
+ List<string> result = new List<string>();
+ foreach(string item in response.values)
+ {
+ result.Add(item);
+ Console.Write(item + ",");
+ }
+ Console.WriteLine("done");
+ Thread.Sleep(1000);
+ return result;
+ }
+
public UserService (Repository source)
{
Source = source;
View
209 BugzillaInterface/gtk-gui/gui.stetic
@@ -311,4 +311,213 @@
</widget>
</child>
</widget>
+ <widget class="Gtk.Bin" id="BugzillaInterface.StringArrayWidget" design-size="300 300">
+ <property name="MemberName" />
+ <property name="Visible">False</property>
+ <child>
+ <widget class="Gtk.VBox" id="vbox7">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.CheckButton" id="enabledCheckbox">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Label" translatable="yes">Enabled</property>
+ <property name="DrawIndicator">True</property>
+ <property name="HasLabel">True</property>
+ <property name="UseUnderline">True</property>
+ <signal name="Toggled" handler="CheckboxToggled" />
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow">
+ <property name="MemberName" />
+ <property name="ShadowType">In</property>
+ <child>
+ <widget class="Gtk.TreeView" id="optionTreeView">
+ <property name="MemberName" />
+ <property name="Sensitive">False</property>
+ <property name="CanFocus">True</property>
+ <property name="ShowScrollbars">True</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="Gtk.Bin" id="BugzillaInterface.StatusFilterWidget" design-size="273 270">
+ <property name="MemberName" />
+ <property name="Visible">False</property>
+ <child>
+ <widget class="Gtk.VBox" id="vbox8">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Frame" id="frame7">
+ <property name="MemberName" />
+ <property name="ShadowType">None</property>
+ <child>
+ <widget class="Gtk.Alignment" id="GtkAlignment">
+ <property name="MemberName" />
+ <property name="Xalign">0</property>
+ <property name="Yalign">0</property>
+ <property name="LeftPadding">12</property>
+ <child>
+ <widget class="BugzillaInterface.StringArrayWidget" id="statusArray">
+ <property name="MemberName" />
+ <property name="Events">ButtonPressMask</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="GtkLabel1">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">&lt;b&gt;Status&lt;/b&gt;</property>
+ <property name="UseMarkup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Frame" id="frame8">
+ <property name="MemberName" />
+ <property name="ShadowType">None</property>
+ <child>
+ <widget class="Gtk.Alignment" id="GtkAlignment1">
+ <property name="MemberName" />
+ <property name="Xalign">0</property>
+ <property name="Yalign">0</property>
+ <property name="LeftPadding">12</property>
+ <child>
+ <widget class="BugzillaInterface.StringArrayWidget" id="resolutionArray">
+ <property name="MemberName" />
+ <property name="Events">ButtonPressMask</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="GtkLabel17">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">&lt;b&gt;Resolution&lt;/b&gt;</property>
+ <property name="UseMarkup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="Gtk.Bin" id="BugzillaInterface.ImportanceWidget" design-size="300 270">
+ <property name="MemberName" />
+ <property name="Visible">False</property>
+ <child>
+ <widget class="Gtk.VBox" id="vbox9">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Frame" id="frame9">
+ <property name="MemberName" />
+ <property name="ShadowType">None</property>
+ <child>
+ <widget class="Gtk.Alignment" id="GtkAlignment">
+ <property name="MemberName" />
+ <property name="Xalign">0</property>
+ <property name="Yalign">0</property>
+ <property name="LeftPadding">12</property>
+ <child>
+ <widget class="BugzillaInterface.StringArrayWidget" id="severityArray">
+ <property name="MemberName" />
+ <property name="Events">ButtonPressMask</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="GtkLabel1">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">&lt;b&gt;Severity&lt;/b&gt;</property>
+ <property name="UseMarkup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Frame" id="frame10">
+ <property name="MemberName" />
+ <property name="ShadowType">None</property>
+ <child>
+ <widget class="Gtk.Alignment" id="GtkAlignment1">
+ <property name="MemberName" />
+ <property name="Xalign">0</property>
+ <property name="Yalign">0</property>
+ <property name="LeftPadding">12</property>
+ <child>
+ <widget class="BugzillaInterface.StringArrayWidget" id="priorityArray">
+ <property name="MemberName" />
+ <property name="Events">ButtonPressMask</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="GtkLabel178">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">&lt;b&gt;Priority&lt;/b&gt;</property>
+ <property name="UseMarkup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
</stetic-interface>
View
11 Frontend/AddQueryDialog.cs
@@ -68,6 +68,12 @@ public AddQueryDialog ()
filterWidgets.Add(new ProductFilterWidget());
filterNames.Add("Product");
+ filterWidgets.Add(new StatusFilterWidget());
+ filterNames.Add("Status");
+
+ filterWidgets.Add(new ImportanceWidget());
+ filterNames.Add("Importance");
+
// set up the treeview columns
TreeViewColumn filterColumn = new TreeViewColumn();
CellRendererText filterRenderer = new CellRendererText();
@@ -153,6 +159,11 @@ protected virtual void ComboBoxChanged (object sender, System.EventArgs e)
if(sourceSelector.Active != 0)
{
testQueryButton.Sensitive = true;
+ foreach(Widget filterWidget in filterWidgets)
+ {
+ IFilterWidget item = (IFilterWidget)filterWidget;
+ item.SetNewSourceID(sourceSelector.Active - 1);
+ }
}
else
{
View
10 Frontend/MainWindow.cs
@@ -144,8 +144,14 @@ protected virtual void DeleteQuery (object sender, System.EventArgs e)
foreach(TreePath selected in selectedQueries)
{
- int index = selected.Indices[0];
- Console.WriteLine ("Deleting query with index {0}", index);
+ if(selected.Indices.Length == 1)// Root node
+ {
+ int index = selected.Indices[0];
+
+ Console.WriteLine ("Deleting query with index {0}", index);
+ SplatterCore.Instance.Queries.RemoveAt(index);
+ }
+
}
}
}
View
7 Frontend/NewSourceDialog.cs
@@ -50,6 +50,9 @@ protected virtual void VerifyButtonClicked (object sender, System.EventArgs e)
if(target.LoginAndVerify())
{
+ statusLabel.Text = "Status: Login Success! Getting details. Please wait";
+ target.FetchLegalValues();
+
// login success
statusLabel.Text = "Status: <b>Verified!</b>";
@@ -86,6 +89,10 @@ protected virtual void OKButtonClicked (object sender, System.EventArgs e)
SplatterCore.Instance.SaveState();
parentDialog.UpdateAvailableSources();
+
+ // Close the dialog
+ this.HideAll();
+ this.Dispose();
}
Please sign in to comment.
Something went wrong with that request. Please try again.