diff options
author | Matěj Cepl <mcepl@redhat.com> | 2011-04-21 23:58:00 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2011-06-05 14:46:49 +0200 |
commit | ca6d6953457b0176f9aed372367cb2645e575f3e (patch) | |
tree | 013fb4f722db1613f90fd67801dc7550f33ded1e /data/lib | |
parent | 9a2e436b841d7c0d9d162b1d386a4316c7feb62e (diff) | |
download | bugzilla-triage-ca6d6953457b0176f9aed372367cb2645e575f3e.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.js | 75 | ||||
-rw-r--r-- | data/lib/util.js | 2 |
2 files changed, 33 insertions, 44 deletions
diff --git a/data/lib/rhbzpage.js b/data/lib/rhbzpage.js index 6b8ee9f..43d34c2 100644 --- a/data/lib/rhbzpage.js +++ b/data/lib/rhbzpage.js @@ -222,36 +222,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'); @@ -278,9 +249,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) { @@ -288,19 +260,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 5b628cf..b145d25 100644 --- a/data/lib/util.js +++ b/data/lib/util.js @@ -357,7 +357,7 @@ NotLoggedinException.prototype.toString = function () { }; // Are we debugging? -var debugFlag = false; +var debugFlag = true; console.myDebug = function myDebug(str) { if (debugFlag) { |