aboutsummaryrefslogtreecommitdiffstats
path: root/data/lib
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2011-04-21 23:58:00 +0200
committerMatěj Cepl <mcepl@redhat.com>2011-04-21 23:58:00 +0200
commitbbb82ff2393d9a2f0c6fd7a3b3edb496effa9a36 (patch)
tree6dad7e01e56db7c42eb3008ce983bf671df2894f /data/lib
parentbf9f8023e823a0bac6ce66744f94c7e077e446f1 (diff)
downloadbugzilla-triage-bbb82ff2393d9a2f0c6fd7a3b3edb496effa9a36.tar.gz
Fix nvidia.
What to do when nvidia chipset is using VESA drivers or something similar. Driver names are not 100% proxy for the card type.
Diffstat (limited to 'data/lib')
-rw-r--r--data/lib/rhbzpage.js78
-rw-r--r--data/lib/util.js3
2 files changed, 35 insertions, 46 deletions
diff --git a/data/lib/rhbzpage.js b/data/lib/rhbzpage.js
index 3cffbb9..706c8c1 100644
--- a/data/lib/rhbzpage.js
+++ b/data/lib/rhbzpage.js
@@ -1,9 +1,6 @@
// Released under the MIT/X11 license
// http://www.opensource.org/licenses/mit-license.php
-// Are we debugging?
-var debugFlag = false;
-
// For identification of graphics card
var manuChipStrs = [ [ "ATI Radeon", "ATI", "1002" ],
[ "ATI Mobility Radeon", "ATI", "1002" ],
@@ -223,36 +220,7 @@ function addCheckXorgLogLink(attList) {
* @return None
*
*/
-function fillInWhiteBoard(PCIidArrObj) {
- var outStr = "";
- var cardIDStr = "";
- var cardIDArr = [];
- var cardName = "";
- var PCIid = (PCIidArrObj.id[0] + "," + PCIidArrObj.id[1]).toUpperCase();
-
- console.myDebug("PCIidArrObj = " + PCIidArrObj.toSource());
- console.myDebug("PCIid = " + PCIid);
-
- // Nvidia driver provides good code in the
- if (PCIidArrObj.id[0].toLowerCase() == "10de") {
- // The following is wrong ... chipsetLine is String, not an array
- console.myDebug("fillInWhiteBoard: chipsetLine = " + PCIidArrObj.chipsetLine);
- cardName = PCIidArrObj.chipsetLine[2].replace(/\s*nvidia\s*/ig,"").
- replace('"','','g');
- }
- else {
- try {
- cardName = constantData.chipNames[PCIid][0];
- } catch (e if e instanceof TypeError) {
- PCIid = PCIid.toLowerCase().replace(",",":");
- postMessage(new Message("SetClipboard", PCIid.toString()));
- alert("PCI ID " + PCIid + " is not known!");
- return ; // early termination
- } catch (e) {
- throw e;
- }
- }
-
+function fillInWhiteBoard(cardName) {
console.myDebug("fillInWhiteBoard: cardName = " + cardName);
clickMouse("editme_action");
var titleElem = document.getElementById('short_desc');
@@ -279,9 +247,10 @@ function fillInChipMagic(XlogID) {
*/
function chipsetMagic (interestingLineArr) {
// parse Xorg.0.log
- var chipsetLine = "";
+ var cardStr = "";
console.myDebug("interestingLineArr = " + interestingLineArr.toSource());
console.myDebug("interestingLineArr[1] = " + interestingLineArr[1]);
+
if (interestingLineArr.length >0) {
var interestingArray = interestingLineArr[0];
if (interestingArray.length > 1) {
@@ -289,19 +258,36 @@ function chipsetMagic (interestingLineArr) {
// If we have Chipset line, we should parse it as well and
// add to the button
if (interestingLineArr.length > 1) {
- chipsetLine = interestingLineArr[1];
- console.myDebug("chipsetLine = " + chipsetLine.toSource());
- } else {
- chipsetLine = null;
- console.myDebug("chipsetLine = " + chipsetLine);
+ var PCIid = (interestingPCIID[0] + "," + interestingPCIID[1]).
+ toUpperCase();
+ // Nvidia driver provides good code in the Chipset line
+ if (interestingPCIID[0].toLowerCase() == "10de") {
+ cardStr = interestingLineArr[1][2].
+ replace(/\s*nvidia\s*/ig,"").
+ replace('"','','g');
+ } else {
+ try {
+ cardStr = constantData.chipNames[PCIid][0];
+ } catch (e if e instanceof TypeError) {
+ PCIid = PCIid.toLowerCase().replace(",",":");
+ cardStr = null;
+ alert("PCI ID " + PCIid + " is not known!");
+ postMessage(new Message("SetClipboard", PCIid.toString()));
+ } catch (e) {
+ throw e;
+ }
+ }
+ }
+ else {
+ cardStr = null;
+ }
+
+ if (cardStr) {
+ createNewButton("short_desc_nonedit_display", false, {
+ "name": "Fill In",
+ "chipMagic": cardStr,
+ });
}
- createNewButton("short_desc_nonedit_display", false, {
- "name": "Fill In",
- "chipMagic": {
- "id": interestingPCIID,
- "chipsetLine": chipsetLine
- },
- });
}
}
}
diff --git a/data/lib/util.js b/data/lib/util.js
index 51f3704..cf916ea 100644
--- a/data/lib/util.js
+++ b/data/lib/util.js
@@ -352,6 +352,9 @@ NotLoggedinException.prototype.toString = function () {
return this.name + ': "' + this.message + '"';
};
+// Are we debugging?
+var debugFlag = true;
+
console.myDebug = function myDebug(str) {
if (debugFlag) {
console.log(str);