add shortcuts to filedialogs directory buttons; small gnome patch from Michael

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3353 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2002-01-13 15:01:25 +00:00
parent 7bb99be122
commit c890dfa0f8
20 changed files with 83 additions and 66 deletions

View File

@ -1,3 +1,7 @@
2002-01-13 Michael A. Koziarski <michael@koziarski.com>
* configure.in: Fix the includes for gnome.
2002-01-12 John Levon <moz@compsoc.man.ac.uk>
* configure.in: change for Aiksaurus 0.14

View File

@ -208,8 +208,8 @@ dnl Ensure gnome-config is available...
FRONTEND="gnome"
FRONTEND_GUILIB="gnome/libgnome.la"
FRONTEND_LDFLAGS="\$(GNOMEMM_LIBDIR)"
FRONTEND_INCLUDES="-I\${srcdir}/gnome \$(GNOMEMM_INCLUDEDIR) \$(GTKMM_CFLAGS)"
FRONTEND_LIBS="\$(GNOMEMM_LIBS) \$(GTKMM_LIBS) `gnome-config --libs libglade`";;
FRONTEND_INCLUDES="-I\${srcdir}/gnome \$(GNOMEMM_INCLUDEDIR) \$(GTKMM_CFLAGS) `gnome-config --cflags libglade gnomeui`"
FRONTEND_LIBS="\$(GNOMEMM_LIBS) \$(GTKMM_LIBS) `gnome-config --libs libglade gnomeui`";;
qt2)
QT2_DO_IT_ALL
FRONTEND="qt2"

View File

@ -1438,9 +1438,9 @@ void BufferView::Pimpl::MenuInsertLyXFile(string const & filen)
FileDialog fileDlg(bv_->owner(),
_("Select LyX document to insert"),
LFUN_FILE_INSERT,
make_pair(string(_("Documents")),
make_pair(string(_("Documents|#o#O")),
string(lyxrc.document_path)),
make_pair(string(_("Examples")),
make_pair(string(_("Examples|#E#e")),
string(AddPath(system_lyxdir, "examples"))));
FileDialog::Result result =

View File

@ -1,5 +1,10 @@
2002-01-13 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* BufferView_pimpl.C (MenuInsertLyXFile):
* lyxfunc.C (menuNew):
(open):
(doImport): add shortcuts to directory buttons
* BufferView_pimpl.C (workAreaButtonRelease): remove dead code (to
open a float)

View File

@ -1,3 +1,11 @@
2002-01-13 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* helper_funcs.h (browseFile): add default empty button descriptions.
* ControlGraphics.C (Browse):
* ControlBibtex.C (Browse):
* ControlInclude.C (Browse): add shortcuts to directory buttons
2002-01-12 John Levon <moz@compsoc.man.ac.uk>
* ControlThesaurus.h:

View File

@ -65,7 +65,6 @@ string const ControlBibtex::Browse(string const & in_name,
string const & title,
string const & pattern)
{
pair<string, string> dir1(N_("Documents"), string(lyxrc.document_path));
return browseFile(&lv_, in_name, title, pattern,
dir1,make_pair(string(), string()));
pair<string, string> dir1(N_("Documents|#o#O"), string(lyxrc.document_path));
return browseFile(&lv_, in_name, title, pattern, dir1);
}

View File

@ -161,7 +161,7 @@ string const ControlExternal::Browse(string const & input) const
FileDialog fileDlg(&lv_,
_("Select external file"),
LFUN_SELECT_FILE_SYNC,
make_pair(string(_("Document")), string(buf)));
make_pair(string(_("Document|#o#O")), string(buf)));
/// Determine the template file extension
ExternalTemplate const & et = params().templ;

View File

@ -77,7 +77,7 @@ extern string user_lyxdir;
string const ControlGraphics::Browse(string const & in_name)
{
string const title = N_("Graphics");
string const title = N_("Graphics|#G#g");
// FIXME: currently we need the second '|' to prevent mis-interpretation
string const pattern = "*.(eps|png|jpeg|jpg|gif)|";
@ -87,9 +87,8 @@ string const ControlGraphics::Browse(string const & in_name)
if (!(fileInfo.isOK() && fileInfo.isDir()))
// No - bail out to system clipart directory
clipdir = AddName (system_lyxdir, "clipart");
pair<string, string> dir1(N_("Clipart"), clipdir);
pair<string, string> dir1(N_("Clipart|#C#c"), clipdir);
// Show the file browser dialog
return browseFile(&lv_, in_name, title, pattern, dir1,
make_pair(string(), string()));
return browseFile(&lv_, in_name, title, pattern, dir1);
}

View File

@ -67,10 +67,10 @@ string const ControlInclude::Browse(string const & in_name, Type in_type)
break;
}
pair<string, string> dir1(N_("Documents"), string(lyxrc.document_path));
pair<string, string> dir1(N_("Documents|#o#O"),
string(lyxrc.document_path));
return browseFile(&lv_, in_name, title, pattern, dir1,
make_pair(string(), string()));
return browseFile(&lv_, in_name, title, pattern, dir1);
}

View File

@ -91,7 +91,5 @@ string const ControlPrint::Browse(string const & in_name)
string const pattern = "*.ps";
// Show the file browser dialog
return browseFile(&lv_, in_name, title, pattern,
make_pair(string(), string()),
make_pair(string(), string()));
return browseFile(&lv_, in_name, title, pattern);
}

View File

@ -42,8 +42,8 @@ class LyXView;
string const browseFile(LyXView *lv, string const & filename,
string const & title,
string const & pattern,
std::pair<string,string> const & dir1,
std::pair<string,string> const & dir2);
std::pair<string,string> const & dir1 = std::make_pair(string(), string()),
std::pair<string,string> const & dir2 = std::make_pair(string(), string()));
/// Returns a vector of units that can be used to create a valid LaTeX length.

View File

@ -1,3 +1,15 @@
2002-01-13 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* FormPreferences.C (Interface::input):
(Language::input):
(Paths::input): add shortcuts to file dialogs directory buttons
* FormPreference.h (browse): add default empty parameters for
buttons descriptions.
* FormFiledialog.C (SetButton): allow for a shortcut in the name
of the button.
2002-01-13 John Levon <moz@compsoc.man.ac.uk>
* FormThesaurus.C:

View File

@ -27,6 +27,8 @@ using std::sort;
#include "support/lstrings.h"
#include "gettext.h"
#include "frontends/Dialogs.h"
#include "xforms_helpers.h"
#ifdef HAVE_ERRNO_H
#include <cerrno>
@ -480,7 +482,8 @@ void FileDialog::Private::SetButton(int iIndex, string const & pszName,
} else return;
if (!pszName.empty()) {
fl_set_object_label(pObject, pszName.c_str());
fl_set_object_label(pObject, idex(pszName.c_str()));
fl_set_button_shortcut(pObject, scex(pszName.c_str()), 1);
fl_show_object(pObject);
*pTemp = pszPath;
} else {

View File

@ -76,7 +76,9 @@ void FormParagraph::changedParagraph()
Paragraph const * const p = getCurrentParagraph();
if (p == 0 || p == par_)
return;
#ifdef WITH_WARNINGS
#warning Please someone of you GUII people have a look at this!
#endif
// shouldn't we chage the par_ pointer too?
// anyway for me the below function does just nothing!
// (Jug 20020108)

View File

@ -1528,11 +1528,11 @@ bool FormPreferences::Interface::input(FL_OBJECT const * const ob)
{
if (ob == dialog_->button_bind_file_browse) {
string dir = AddName(system_lyxdir, "bind");
string name = N_("Sys Bind");
string name = N_("Sys Bind|#S#s");
pair<string,string> dir1(name, dir);
dir = AddName(user_lyxdir, "bind");
name = N_("User Bind");
name = N_("User Bind|#U#u");
pair<string,string> dir2(name, dir);
parent_.browse(dialog_->input_bind_file,
@ -1540,11 +1540,11 @@ bool FormPreferences::Interface::input(FL_OBJECT const * const ob)
} else if (ob == dialog_->button_ui_file_browse) {
string dir = AddName(system_lyxdir, "ui");
string name = N_("Sys UI");
string name = N_("Sys UI|#S#s");
pair<string,string> dir1(name, dir);
dir = AddName(user_lyxdir, "ui");
name = N_("User UI");
name = N_("User UI|#U#u");
pair<string,string> dir2(name, dir);
parent_.browse(dialog_->input_ui_file,
@ -1736,20 +1736,18 @@ bool FormPreferences::Language::input(FL_OBJECT const * const ob)
if (ob == dialog_->button_kbmap1_browse) {
string const dir = AddName(system_lyxdir, "kbd");
string const name = N_("Key maps");
string const name = N_("Key maps|#K#k");
pair<string, string> dir1(name, dir);
parent_.browse(dialog_->input_kbmap1,
N_("Keyboard map"), "*.kmap", dir1,
make_pair(string(), string()));
N_("Keyboard map"), "*.kmap", dir1);
} else if (ob == dialog_->button_kbmap2_browse) {
string const dir = AddName(system_lyxdir, "kbd");
string const name = N_("Key maps");
string const name = N_("Key maps|#K#k");
pair<string, string> dir1(name, dir);
parent_.browse(dialog_->input_kbmap2,
N_("Keyboard map"), "*.kmap", dir1,
make_pair(string(), string()));
N_("Keyboard map"), "*.kmap", dir1);
}
return activate;
@ -2219,35 +2217,24 @@ bool FormPreferences::Paths::input(FL_OBJECT const * const ob)
if (ob == dialog_->button_default_path_browse) {
parent_.browse(dialog_->input_default_path,
N_("Default path"), string(),
make_pair(string(), string()),
make_pair(string(), string()));
N_("Default path"), string());
} else if (ob == dialog_->button_template_path_browse) {
parent_.browse(dialog_->input_template_path,
N_("Template path"), string(),
make_pair(string(), string()),
make_pair(string(), string()));
N_("Template path"), string());
} else if (ob == dialog_->button_temp_dir_browse) {
parent_.browse(dialog_->input_temp_dir,
N_("Temp dir"), string(),
make_pair(string(), string()),
make_pair(string(), string()));
N_("Temp dir"), string());
} else if (ob == dialog_->button_lastfiles_browse) {
pair<string, string> dir(_("User"), user_lyxdir);
pair<string, string> dir(_("User|#U#u"), user_lyxdir);
parent_.browse(dialog_->input_lastfiles,
N_("Lastfiles"), string(), dir,
make_pair(string(), string()));
N_("Lastfiles"), string(), dir);
} else if (ob == dialog_->button_backup_path_browse) {
parent_.browse(dialog_->input_backup_path,
N_("Backup path"), string(),
make_pair(string(), string()),
make_pair(string(), string()));
N_("Backup path"), string());
} else if (ob == dialog_->button_serverpipe_browse) {
parent_.browse(dialog_->input_serverpipe,
N_("LyX Server pipes"), string(),
make_pair(string(), string()),
make_pair(string(), string()));
N_("LyX Server pipes"), string());
}
return activate;
@ -2946,9 +2933,7 @@ bool FormPreferences::SpellOptions::input(FL_OBJECT const * const ob)
if (ob == dialog_->button_personal_dict) {
parent_.browse(dialog_->input_personal_dict,
N_("Personal dictionary"), "*.ispell",
make_pair(string(), string()),
make_pair(string(), string()));
N_("Personal dictionary"), "*.ispell");
}
return true; // All input is valid!

View File

@ -95,8 +95,8 @@ private:
*/
void browse( FL_OBJECT * input,
string const & title, string const & pattern,
std::pair<string,string> const & dir1,
std::pair<string,string> const & dir2 );
std::pair<string,string> const & dir1= make_pair(string(),string()),
std::pair<string,string> const & dir2 = make_pair(string(),string()));
/// Fdesign generated methods
FD_form_preferences * build_preferences();

View File

@ -1,5 +1,7 @@
2002-01-13 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* figinset.C (browseFile): add shortcuts to directory buttons
* insettext.C (updateLocal): update menubar and toolbar here too.
2002-01-13 Allan Rae <rae@lyx.org>

View File

@ -1979,8 +1979,8 @@ void InsetFig::browseFile()
FileDialog fileDlg(current_view->owner(), _("Select an EPS figure"),
LFUN_SELECT_FILE_SYNC,
make_pair(string(_("Clip art")), string(bufclip)),
make_pair(string(_("Documents")), string(buf)));
make_pair(string(_("Clip art|#C#c")), string(bufclip)),
make_pair(string(_("Documents|#o#O")), string(buf)));
bool error = false;
do {

View File

@ -170,9 +170,9 @@ bool WriteAs(BufferView * bv, Buffer * buffer, string const & filename)
FileDialog fileDlg(bv->owner(),
_("Choose a filename to save document as"),
LFUN_WRITEAS,
make_pair(string(_("Documents")),
make_pair(string(_("Documents|#o#O")),
string(lyxrc.document_path)),
make_pair(string(_("Templates")),
make_pair(string(_("Templates|#T#t")),
string(lyxrc.template_path)));
if (!IsLyXFilename(fname))

View File

@ -1664,9 +1664,9 @@ void LyXFunc::menuNew(bool fromTemplate)
if (lyxrc.new_ask_filename) {
FileDialog fileDlg(owner, _("Enter filename for new document"),
LFUN_SELECT_FILE_SYNC,
make_pair(string(_("Documents")),
make_pair(string(_("Documents|#o#O")),
string(lyxrc.document_path)),
make_pair(string(_("Templates")),
make_pair(string(_("Templates|#T#t")),
string(lyxrc.template_path)));
FileDialog::Result result =
@ -1748,9 +1748,9 @@ void LyXFunc::menuNew(bool fromTemplate)
if (fromTemplate) {
FileDialog fileDlg(owner, _("Select template file"),
LFUN_SELECT_FILE_SYNC,
make_pair(string(_("Documents")),
make_pair(string(_("Documents|#o#O")),
string(lyxrc.document_path)),
make_pair(string(_("Templates")),
make_pair(string(_("Templates|#T#t")),
string(lyxrc.template_path)));
FileDialog::Result result =
@ -1789,9 +1789,9 @@ void LyXFunc::open(string const & fname)
if (fname.empty()) {
FileDialog fileDlg(owner, _("Select document to open"),
LFUN_FILE_OPEN,
make_pair(string(_("Documents")),
make_pair(string(_("Documents|#o#O")),
string(lyxrc.document_path)),
make_pair(string(_("Examples")),
make_pair(string(_("Examples|#E#e")),
string(AddPath(system_lyxdir, "examples"))));
FileDialog::Result result =
@ -1866,9 +1866,9 @@ void LyXFunc::doImport(string const & argument)
FileDialog fileDlg(owner, text,
LFUN_IMPORT,
make_pair(string(_("Documents")),
make_pair(string(_("Documents|#o#O")),
string(lyxrc.document_path)),
make_pair(string(_("Examples")),
make_pair(string(_("Examples|#E#e")),
string(AddPath(system_lyxdir, "examples"))));
string const extension = "*." + formats.extension(format)