Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- === modified file 'win32/DirectoryListingFrame.cpp'
- --- win32/DirectoryListingFrame.cpp 2010-07-10 14:36:48 +0000
- +++ win32/DirectoryListingFrame.cpp 2010-11-20 17:09:14 +0000
- @@ -49,6 +49,8 @@
- DirectoryListingFrame::UserMap DirectoryListingFrame::lists;
- +TStringList DirectoryListingFrame::lastSearches;
- +
- int DirectoryListingFrame::ItemInfo::getImage() const {
- if(type == DIRECTORY || type == USER) {
- return dir->getComplete() ? WinUtil::getDirIconIndex() : WinUtil::getDirMaskedIndex();
- @@ -891,12 +893,20 @@
- {
- if(!findNext) {
- // Prompt for substring to find
- - ParamDlg dlg(this, T_("Search for file"), T_("Enter search string"));
- + ParamDlg dlg(this, T_("Search for file"), T_("Enter search string"), lastSearches, 0, true /*comboBoxEdit*/);
- if(dlg.run() != IDOK)
- return;
- - findStr = Text::fromT(dlg.getValue());
- + tstring value = dlg.getValue();
- + if(!value.empty() && std::find(lastSearches.begin(), lastSearches.end(), value) == lastSearches.end()) {
- + size_t i = max(SETTING(SEARCH_HISTORY)-1, 0);
- + while(lastSearches.size() > i) {
- + lastSearches.erase(lastSearches.end());
- + }
- + lastSearches.insert(lastSearches.begin(), value);
- + }
- + findStr = Text::fromT(value);
- skipHits = 0;
- } else {
- skipHits++;
- === modified file 'win32/DirectoryListingFrame.h'
- --- win32/DirectoryListingFrame.h 2010-07-10 14:36:48 +0000
- +++ win32/DirectoryListingFrame.h 2010-11-20 15:48:33 +0000
- @@ -182,6 +182,8 @@
- bool updating;
- bool searching;
- + static TStringList lastSearches;
- +
- StringMap ucLineParams;
- typedef unordered_map<UserPtr, DirectoryListingFrame*, User::Hash> UserMap;
- === modified file 'win32/ParamDlg.cpp'
- --- win32/ParamDlg.cpp 2010-07-10 14:36:48 +0000
- +++ win32/ParamDlg.cpp 2010-11-20 16:07:38 +0000
- @@ -39,12 +39,12 @@
- addTextBox(name, value, password);
- }
- -ParamDlg::ParamDlg(dwt::Widget* parent, const tstring& title, const tstring& name, const TStringList& choices, size_t sel) :
- +ParamDlg::ParamDlg(dwt::Widget* parent, const tstring& title, const tstring& name, const TStringList& choices, size_t sel, bool edit) :
- GridDialog(parent, width),
- left(0)
- {
- onInitDialog(std::bind(&ParamDlg::initDialog, this, title));
- - addComboBox(name, choices, sel);
- + addComboBox(name, choices, sel, edit);
- }
- void ParamDlg::addTextBox(const tstring& name, const tstring& value, bool password) {
- @@ -55,8 +55,8 @@
- initFs.push_back(std::bind(&ParamDlg::initIntTextBox, this, name, value, min, max));
- }
- -void ParamDlg::addComboBox(const tstring& name, const TStringList& choices, size_t sel) {
- - initFs.push_back(std::bind(&ParamDlg::initComboBox, this, name, choices, sel));
- +void ParamDlg::addComboBox(const tstring& name, const TStringList& choices, size_t sel, bool edit) {
- + initFs.push_back(std::bind(&ParamDlg::initComboBox, this, name, choices, sel, edit));
- }
- void ParamDlg::initTextBox(const tstring& name, const tstring& value, bool password) {
- @@ -80,8 +80,8 @@
- valueFs.push_back(std::bind((tstring (TextBox::*)() const)(&TextBox::getText), box));
- }
- -void ParamDlg::initComboBox(const tstring& name, const TStringList& choices, size_t sel) {
- - ComboBoxPtr box = left->addChild(GroupBox::Seed(name))->addChild(WinUtil::Seeds::Dialog::comboBox);
- +void ParamDlg::initComboBox(const tstring& name, const TStringList& choices, size_t sel, bool edit) {
- + ComboBoxPtr box = left->addChild(GroupBox::Seed(name))->addChild(edit ? WinUtil::Seeds::Dialog::comboBoxEdit : WinUtil::Seeds::Dialog::comboBox);
- for(TStringList::const_iterator i = choices.begin(), iend = choices.end(); i != iend; ++i)
- box->addValue(*i);
- box->setSelected(sel);
- === modified file 'win32/ParamDlg.h'
- --- win32/ParamDlg.h 2010-07-10 14:36:48 +0000
- +++ win32/ParamDlg.h 2010-11-20 16:07:13 +0000
- @@ -32,11 +32,11 @@
- /// shorthand constructor that adds a text box
- ParamDlg(dwt::Widget* parent, const tstring& title, const tstring& name, const tstring& value = Util::emptyStringT, bool password = false);
- /// shorthand constructor that adds a combo box
- - ParamDlg(dwt::Widget* parent, const tstring& title, const tstring& name, const TStringList& choices, size_t sel = 0);
- + ParamDlg(dwt::Widget* parent, const tstring& title, const tstring& name, const TStringList& choices, size_t sel = 0, bool edit = false);
- void addTextBox(const tstring& name, const tstring& value = Util::emptyStringT, bool password = false);
- void addIntTextBox(const tstring& name, const tstring& value, const int min = UD_MINVAL, const int max = UD_MAXVAL);
- - void addComboBox(const tstring& name, const TStringList& choices, size_t sel = 0);
- + void addComboBox(const tstring& name, const TStringList& choices, size_t sel = 0, bool edit = false);
- const TStringList& getValues() const { return values; }
- const tstring& getValue() const { return values[0]; }
- @@ -52,7 +52,7 @@
- void initTextBox(const tstring& name, const tstring& value, bool password);
- void initIntTextBox(const tstring& name, const tstring& value, const int min, const int max);
- - void initComboBox(const tstring& name, const TStringList& choices, size_t sel);
- + void initComboBox(const tstring& name, const TStringList& choices, size_t sel, bool edit);
- bool initDialog(const tstring& title);
- void okClicked();
- === modified file 'win32/WinUtil.cpp'
- --- win32/WinUtil.cpp 2010-10-29 16:31:08 +0000
- +++ win32/WinUtil.cpp 2010-11-20 17:11:38 +0000
- @@ -88,6 +88,7 @@
- const Tree::Seed WinUtil::Seeds::treeView;
- const ComboBox::Seed WinUtil::Seeds::Dialog::comboBox;
- +const ComboBox::Seed WinUtil::Seeds::Dialog::comboBoxEdit;
- const TextBox::Seed WinUtil::Seeds::Dialog::textBox;
- const TextBox::Seed WinUtil::Seeds::Dialog::intTextBox;
- const RichTextBox::Seed WinUtil::Seeds::Dialog::richTextBox;
- === modified file 'win32/WinUtil.h'
- --- win32/WinUtil.h 2010-10-24 18:06:17 +0000
- +++ win32/WinUtil.h 2010-11-20 16:18:14 +0000
- @@ -85,6 +85,7 @@
- struct Dialog {
- static const ComboBox::Seed comboBox;
- + static const ComboBox::Seed comboBoxEdit;
- static const TextBox::Seed textBox;
- static const TextBox::Seed intTextBox;
- static const RichTextBox::Seed richTextBox;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement