Changeset 1902


Ignore:
Timestamp:
2001-02-06T00:03:54+13:00 (23 years ago)
Author:
sjboddie
Message:

Prevent "preferences" page from displaying "encoding" menu if only one
encoding is enabled.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/pageaction.cpp

    r1877 r1902  
    361361    // _encodingoption_
    362362    // create the "encoding" selection box for the preferences page
    363     text_t &arg_w = args["w"];
    364     text_t encodingoption;
    365     text_tmap::const_iterator thisenc = configinfo.encodings.begin();
    366     text_tmap::const_iterator endenc = configinfo.encodings.end();
    367     while (thisenc != endenc) {
    368       encodingoption += "<option value=\"" + (*thisenc).second + "\"";
    369       if ((*thisenc).second == arg_w) encodingoption += " selected";
    370       encodingoption += ">" + (*thisenc).first + "\n";
    371       thisenc ++;
    372     }
    373 
    374     if (!encodingoption.empty()) {
     363    if (configinfo.encodings.size() > 1) {
     364      text_t &arg_w = args["w"];
     365      text_t encodingoption;
     366      text_tmap::const_iterator thisenc = configinfo.encodings.begin();
     367      text_tmap::const_iterator endenc = configinfo.encodings.end();
     368      while (thisenc != endenc) {
     369    encodingoption += "<option value=\"" + (*thisenc).second + "\"";
     370    if ((*thisenc).second == arg_w) encodingoption += " selected";
     371    encodingoption += ">" + (*thisenc).first + "\n";
     372    thisenc ++;
     373      }
     374
    375375      encodingoption = "<select name=\"w\" onChange=\"updatew();\">\n" + encodingoption;
    376376      encodingoption += "</select>\n";
Note: See TracChangeset for help on using the changeset viewer.