From: Jean-Marc Lasgouttes Date: Sun, 13 Jan 2002 15:01:25 +0000 (+0000) Subject: add shortcuts to filedialogs directory buttons; small gnome patch from Michael X-Git-Tag: 1.6.10~20037 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=c890dfa0f8e80f10e8ad9b899867c7810d4895e1;p=features.git 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 --- diff --git a/ChangeLog b/ChangeLog index 83dce7f792..88a63c6734 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2002-01-13 Michael A. Koziarski + + * configure.in: Fix the includes for gnome. + 2002-01-12 John Levon * configure.in: change for Aiksaurus 0.14 diff --git a/configure.in b/configure.in index 4877da3d8e..d7d1301d32 100644 --- a/configure.in +++ b/configure.in @@ -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" diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index ca62780d4a..8e2021b8ac 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -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 = diff --git a/src/ChangeLog b/src/ChangeLog index 0b35b334fe..47ec906add 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2002-01-13 Jean-Marc Lasgouttes + * 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) diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index 46bbb93905..c0a02c6eb3 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,11 @@ +2002-01-13 Jean-Marc Lasgouttes + + * 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 * ControlThesaurus.h: diff --git a/src/frontends/controllers/ControlBibtex.C b/src/frontends/controllers/ControlBibtex.C index 03b6dba6be..3ac31c5ce9 100644 --- a/src/frontends/controllers/ControlBibtex.C +++ b/src/frontends/controllers/ControlBibtex.C @@ -65,7 +65,6 @@ string const ControlBibtex::Browse(string const & in_name, string const & title, string const & pattern) { - pair dir1(N_("Documents"), string(lyxrc.document_path)); - return browseFile(&lv_, in_name, title, pattern, - dir1,make_pair(string(), string())); + pair dir1(N_("Documents|#o#O"), string(lyxrc.document_path)); + return browseFile(&lv_, in_name, title, pattern, dir1); } diff --git a/src/frontends/controllers/ControlExternal.C b/src/frontends/controllers/ControlExternal.C index f9e357f566..16ab959398 100644 --- a/src/frontends/controllers/ControlExternal.C +++ b/src/frontends/controllers/ControlExternal.C @@ -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; diff --git a/src/frontends/controllers/ControlGraphics.C b/src/frontends/controllers/ControlGraphics.C index 9aa77fa2ea..6c13079749 100644 --- a/src/frontends/controllers/ControlGraphics.C +++ b/src/frontends/controllers/ControlGraphics.C @@ -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 dir1(N_("Clipart"), clipdir); + pair 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); } diff --git a/src/frontends/controllers/ControlInclude.C b/src/frontends/controllers/ControlInclude.C index b81f539ea5..b9775ab4a9 100644 --- a/src/frontends/controllers/ControlInclude.C +++ b/src/frontends/controllers/ControlInclude.C @@ -67,10 +67,10 @@ string const ControlInclude::Browse(string const & in_name, Type in_type) break; } - pair dir1(N_("Documents"), string(lyxrc.document_path)); + pair 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); } diff --git a/src/frontends/controllers/ControlPrint.C b/src/frontends/controllers/ControlPrint.C index cd9cb263c4..a20364380d 100644 --- a/src/frontends/controllers/ControlPrint.C +++ b/src/frontends/controllers/ControlPrint.C @@ -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); } diff --git a/src/frontends/controllers/helper_funcs.h b/src/frontends/controllers/helper_funcs.h index d2af6683b4..095f8bb91a 100644 --- a/src/frontends/controllers/helper_funcs.h +++ b/src/frontends/controllers/helper_funcs.h @@ -42,8 +42,8 @@ class LyXView; string const browseFile(LyXView *lv, string const & filename, string const & title, string const & pattern, - std::pair const & dir1, - std::pair const & dir2); + std::pair const & dir1 = std::make_pair(string(), string()), + std::pair const & dir2 = std::make_pair(string(), string())); /// Returns a vector of units that can be used to create a valid LaTeX length. diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 6185cccdf7..dc2a616c6c 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,15 @@ +2002-01-13 Jean-Marc Lasgouttes + + * 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 * FormThesaurus.C: diff --git a/src/frontends/xforms/FormFiledialog.C b/src/frontends/xforms/FormFiledialog.C index 53cbf5e042..0b4037da38 100644 --- a/src/frontends/xforms/FormFiledialog.C +++ b/src/frontends/xforms/FormFiledialog.C @@ -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 @@ -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 { diff --git a/src/frontends/xforms/FormParagraph.C b/src/frontends/xforms/FormParagraph.C index 141e144791..0fc651e5c3 100644 --- a/src/frontends/xforms/FormParagraph.C +++ b/src/frontends/xforms/FormParagraph.C @@ -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) diff --git a/src/frontends/xforms/FormPreferences.C b/src/frontends/xforms/FormPreferences.C index 4502f3b953..bf519462c6 100644 --- a/src/frontends/xforms/FormPreferences.C +++ b/src/frontends/xforms/FormPreferences.C @@ -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 dir1(name, dir); dir = AddName(user_lyxdir, "bind"); - name = N_("User Bind"); + name = N_("User Bind|#U#u"); pair 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 dir1(name, dir); dir = AddName(user_lyxdir, "ui"); - name = N_("User UI"); + name = N_("User UI|#U#u"); pair 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 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 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 dir(_("User"), user_lyxdir); + pair 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! diff --git a/src/frontends/xforms/FormPreferences.h b/src/frontends/xforms/FormPreferences.h index ceeb3a09c0..09d7e5f6ca 100644 --- a/src/frontends/xforms/FormPreferences.h +++ b/src/frontends/xforms/FormPreferences.h @@ -95,8 +95,8 @@ private: */ void browse( FL_OBJECT * input, string const & title, string const & pattern, - std::pair const & dir1, - std::pair const & dir2 ); + std::pair const & dir1= make_pair(string(),string()), + std::pair const & dir2 = make_pair(string(),string())); /// Fdesign generated methods FD_form_preferences * build_preferences(); diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 56493b7b4d..370fb1b514 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,5 +1,7 @@ 2002-01-13 Jean-Marc Lasgouttes + * figinset.C (browseFile): add shortcuts to directory buttons + * insettext.C (updateLocal): update menubar and toolbar here too. 2002-01-13 Allan Rae diff --git a/src/insets/figinset.C b/src/insets/figinset.C index 659e489c97..e961aec776 100644 --- a/src/insets/figinset.C +++ b/src/insets/figinset.C @@ -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 { diff --git a/src/lyx_cb.C b/src/lyx_cb.C index ba2544d445..43cfb02da6 100644 --- a/src/lyx_cb.C +++ b/src/lyx_cb.C @@ -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)) diff --git a/src/lyxfunc.C b/src/lyxfunc.C index ec2eb4513b..adfe50ce56 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -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)