Project

General

Profile

Actions

Bug #5261

closed

WFileUpload::setFilters can be set only once.

Added by Apivan Tuntakurn over 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
-
Start date:
09/15/2016
Due date:
% Done:

0%

Estimated time:

Description

After the widget is shown, setting the WFileUpload::setFilter will not alter the file browser dialog.

Code:

  WFileUpload* upload = new WFileUpload(this);
  upload->setFilters(".bad");
  upload->setFilters(".txt"); //< switch to .txt

  WComboBox* combo = new WComboBox(this);
  combo->addItem(".txt");
  combo->addItem(".img");
  combo->changed().connect(std::bind([combo, upload]()
  {
    if(combo->currentIndex() == 0)
    {
      Wt::log("info") << "choose .txt";
      upload->setFilters(".txt");
    }
    else if(combo->currentIndex() == 1)
    {
      Wt::log("info") << "choose .img";
      upload->setFilters(".img"); //< won't switch to .img
    }

  }));

Step to reproduce

  1. Click at "Browse..." button.
  2. Observe file dialog which should show "*.txt" option
  3. Change the choice in WCombobox to ".img"
  4. Observe file dialog

Result

The file dialog still shows "*.txt" option

Version

Wt github b8d3cdf9ee0b0bcc16bf9338681ffc9ab27a490b

Environment

Ubuntu 15.10 (FileManager: Nautilus), Windows 10

Actions #1

Updated by Roel Standaert over 7 years ago

  • Status changed from New to InProgress
  • Assignee set to André Jacobs
Actions #2

Updated by André Jacobs over 7 years ago

  • Status changed from InProgress to Implemented @Emweb
Actions #3

Updated by Roel Standaert over 7 years ago

  • Status changed from Implemented @Emweb to Resolved
Actions #4

Updated by Roel Standaert about 7 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF