google-code-export / sqlite-manager

Automatically exported from code.google.com/p/sqlite-manager
1 stars 0 forks source link

Color scheme in query result not working #796

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open SQLite Manager

2. Load any SQLite file which contains a table filled with data, specially 
containing null values, text values and integer values in different columns and 
rows

3. Click at "browse and search", or write any sql query and run it.

What is the actual output?

The table results a list of colums and rows without any colored output

What is the expected output?

The table result is supposed to be colored, as it was working like a month ago 
in any sqlite file.

What version of the product are you using? On what target Application (e.g.
Firefox 4.0.1, etc.)? On what operating system?

Extension Version =
0.8 and 0.7.7

Application = Firefox 22.0

OS = windows 8 (64bits/ english)

Please provide any additional information below. In some cases
errors/warnings may be logged in the Error Console (in Firefox) which is
available under the Tools menu or using Ctrl+Shift+J. If you find any
related to this extension, please report that too.

In Error Console there are two errors in file 
sqlitemanager/content/treeDataTable.js (lines 63 and 80). TypeError: properties 
is undefined

It´s a simple error but it totally ruins the user manual that i'm working on :)

Original issue reported on code.google.com by danie...@gmail.com on 15 Jul 2013 at 9:21

Attachments:

GoogleCodeExporter commented 9 years ago
According to 
https://developer.mozilla.org/en-US/docs/XUL/Tutorial/Styling_a_Tree, this is 
because the "properties" argument of getCellProperties is obsolete as of Gecko 
22. getCellProperties should now return a space separated string of property 
names. There link has suggestions for handling old and new versions of Gecko.

The quick and dirty hack I did to get this working with Firefox 22 is:
  getCellProperties: function(row, col) {
    var properties = "";
    switch(this.aTypes[row][col.id]) {
      case SQLiteTypes.INTEGER:
        properties = "integervalue";
        break;
      case SQLiteTypes.REAL:
        properties= "floatvalue";
        break;
      case SQLiteTypes.BLOB:
        properties = "blobvalue";
        break;
      case SQLiteTypes.NULL:
        properties = "nullvalue";
        break;
      case SQLiteTypes.TEXT:
      default:
        properties = "textvalue";
        break;
    }
    if (typeof this.getCellText(row,col) == "number") {
      properties += " numbervalue";
    }
    properties += " tabledata";

    return properties;
  },

Making that change to treeDataTable.js and repacking the XPI works for me.

Original comment by thisis...@gmail.com on 18 Jul 2013 at 6:47

GoogleCodeExporter commented 9 years ago
There is also a getCellProperties in treeDbStructure.js.  The change I have for 
this is:

  getCellProperties: function(row, col) {
    var properties = "";
    if (this.getSmType(row) == "table") {
      properties = "dbObjTable";
    }
    if (this.getSmType(row) == "index") {
      properties += " dbObjIndex";
    }
    if (this.getSmType(row) == "view") {
      properties += " dbObjView";
    }
    if (this.getSmType(row) == "trigger") {
      properties += " dbObjTrigger";
    }
    return properties;
  },

Original comment by thisis...@gmail.com on 18 Jul 2013 at 6:58

GoogleCodeExporter commented 9 years ago
Thanks a lot for posting this fix!  I hadn't modified an FF extension before, 
but eventually figured it out.  It's great to have color back!  So, what does 
it take to get this fix incorporated into the official extension?  Seems like 
people newly-installing this extension will not be that into it without color, 
which really adds a lot.

Original comment by jdqui...@gmail.com on 19 Jul 2013 at 2:00

GoogleCodeExporter commented 9 years ago
Perfect! Works like a charm! I hope the official release of SQLite Manager gets 
updated as well.

Thanks

Original comment by danie...@gmail.com on 19 Jul 2013 at 3:13