/**
* \file FormFiledialog.C
- * Copyright 2001 the LyX Team
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
*
* \author unknown
- * \author John Levon, moz@compsoc.man.ac.uk
+ * \author John Levon
+ *
+ * Full author contact details are available in file CREDITS
*/
#include <config.h>
tmp.ls_entry_ = buffer;
// creates used name
string temp = fname;
- if (isDir) temp += '/';
+ if (isDir)
+ temp += '/';
tmp.name_ = temp;
// creates displayed name
fl_hide_object(file_dlg_form_->User1);
fl_hide_object(file_dlg_form_->User2);
- r_ = dia.redrawGUI.connect(boost::bind(&FileDialog::Private::redraw, this));
+ r_ = dia.redrawGUI().connect(boost::bind(&FileDialog::Private::redraw, this));
}
// SetButton: sets file selector user button action
-void FileDialog::Private::SetButton(int iIndex, string const & name_,
- string const & pszPath)
+void FileDialog::Private::SetButton(int index, string const & name,
+ string const & path)
{
FL_OBJECT * ob;
- string * pTemp;
+ string * tmp;
- if (iIndex == 0) {
+ if (index == 0) {
ob = file_dlg_form_->User1;
- pTemp = &user_path1_;
- } else if (iIndex == 1) {
+ tmp = &user_path1_;
+ } else if (index == 1) {
ob = file_dlg_form_->User2;
- pTemp = &user_path2_;
- } else return;
+ tmp = &user_path2_;
+ } else {
+ return;
+ }
- if (!name_.empty()) {
- fl_set_object_label(ob, idex(name_.c_str()));
- fl_set_button_shortcut(ob, scex(name_.c_str()), 1);
+ if (!name.empty()) {
+ fl_set_object_label(ob, idex(name.c_str()));
+ fl_set_button_shortcut(ob, scex(name.c_str()), 1);
fl_show_object(ob);
- *pTemp = pszPath;
+ *tmp = path;
} else {
fl_hide_object(ob);
- pTemp->erase();
+ tmp->erase();
}
}
if (HandleOK())
return x_sync_kludge(true);
- } else if (ob == file_dlg_form_->Cancel
- || force_cancel_)
+ } else if (ob == file_dlg_form_->Cancel || force_cancel_)
return x_sync_kludge(false);
else if (force_ok_)
// set info line
bool isDir = true;
int const select_ = fl_get_browser(file_dlg_form_->List);
- if (select_ > depth_) {
+ if (select_ > depth_) {
tmp = dir_entries_[select_ - depth_ - 1].name_;
SetInfoLine(dir_entries_[select_ - depth_ - 1].ls_entry_);
if (!suffixIs(tmp, '/')) {
if (!filename.empty()) {
for (int i = 0; i < fl_get_browser_maxline(file_dlg_form_->List); ++i) {
string s = fl_get_browser_line(file_dlg_form_->List, i + 1);
- s = strip(frontStrip(s));
+ s = trim(s);
if (s == filename) {
sel = i + 1;
break;
}
}
- if (sel != 0) fl_select_browser_line(file_dlg_form_->List, sel);
+ if (sel != 0)
+ fl_select_browser_line(file_dlg_form_->List, sel);
int const top = max(sel - 5, 1);
fl_set_browser_topline(file_dlg_form_->List, top);