mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-16 07:55:41 +00:00
9b64d7bd24
Before this commit, in the paths preferences tab if you put a relative path, LyX would convert it behind the scenes to an absolute path by evaluating the relative path with respect to the working directory of the LyX instance where the preference change is taking place. This seems confusing because (1) it is done behind the scenes (after the preferences dialog is closed) and (2) if the user chooses to enter a relative path, the safest thing to do is to preserve it as a relative path, instead of making the assumption that the user intended for it to be expanded to an absolute path. An explanation of how relative paths are handled is given at the bottom of the paths tab. Note that the height/width of the preferences window is not changed as a result of adding this explanatory comment because the height of the preferences dialog is already stretched by other tabs. This commit improves consistency in the sense that the behavior of LyX is now the same when a relative path is specified in the preferences dialog as when it is manually specified in the preferences file. Before, if the preferences file were manually edited and a relative path were inserted, the next time the user made a change to preferences with the GUI (even if the preference change was a different preference, e.g. instant preview), the relative path would be silently converted to an absolute path, evaluated with respect to the working directory of that instance. Beyond improving clarity and consistency (IMO), this commit allows for a new feature to be implemented of using relative paths in the paths preferences. For example, the user may now enter '.' as the "Working directory" path and now whenever they start LyX from a directory and create a new file, the default location of the file will be the directory from which they started LyX, instead of the user's home directory which is LyX's default and is less intuitive. No prefs2prefs work is needed because if a relative path were entered in the preferences dialog before this commit, it was converted to an absolute path before being stored in preferences. If a relative path were specified by manually editing the preferences file, then (unless the path were already automatically converted to an absolute path by a GUI preferences change, as described above) the behavior will be the same (the path will be treated as a relative path). For related discussion, see the lyx-devel thread here: https://www.mail-archive.com/search?l=mid&q=20160616003010.bnymtcouar7g55ti%40cotopaxi This commit removes the last use of lyx::support::expandPath() in LyX's sources. |
||
---|---|---|
.. | ||
ui | ||
.gitignore | ||
Action.cpp | ||
Action.h | ||
BulletsModule.cpp | ||
BulletsModule.h | ||
ButtonController.cpp | ||
ButtonController.h | ||
ButtonPolicy.cpp | ||
ButtonPolicy.h | ||
CategorizedCombo.cpp | ||
CategorizedCombo.h | ||
CMakeLists.txt | ||
ColorCache.cpp | ||
ColorCache.h | ||
CustomizedWidgets.cpp | ||
CustomizedWidgets.h | ||
Dialog.cpp | ||
Dialog.h | ||
DialogView.h | ||
DockView.h | ||
EmptyTable.cpp | ||
EmptyTable.h | ||
FancyLineEdit.cpp | ||
FancyLineEdit.h | ||
FileDialog.cpp | ||
FileDialog.h | ||
FindAndReplace.cpp | ||
FindAndReplace.h | ||
FloatPlacement.cpp | ||
FloatPlacement.h | ||
GuiAbout.cpp | ||
GuiAbout.h | ||
GuiAlert.cpp | ||
GuiApplication.cpp | ||
GuiApplication.h | ||
GuiBibitem.cpp | ||
GuiBibitem.h | ||
GuiBibtex.cpp | ||
GuiBibtex.h | ||
GuiBox.cpp | ||
GuiBox.h | ||
GuiBranch.cpp | ||
GuiBranch.h | ||
GuiBranches.cpp | ||
GuiBranches.h | ||
GuiChanges.cpp | ||
GuiChanges.h | ||
GuiCharacter.cpp | ||
GuiCharacter.h | ||
GuiCitation.cpp | ||
GuiCitation.h | ||
GuiClipboard.cpp | ||
GuiClipboard.h | ||
GuiCommandBuffer.cpp | ||
GuiCommandBuffer.h | ||
GuiCommandEdit.cpp | ||
GuiCommandEdit.h | ||
GuiCompare.cpp | ||
GuiCompare.h | ||
GuiCompareHistory.cpp | ||
GuiCompareHistory.h | ||
GuiCompleter.cpp | ||
GuiCompleter.h | ||
GuiDelimiter.cpp | ||
GuiDelimiter.h | ||
GuiDialog.cpp | ||
GuiDialog.h | ||
GuiDocument.cpp | ||
GuiDocument.h | ||
GuiErrorList.cpp | ||
GuiErrorList.h | ||
GuiERT.cpp | ||
GuiERT.h | ||
GuiExternal.cpp | ||
GuiExternal.h | ||
GuiFontExample.cpp | ||
GuiFontExample.h | ||
GuiFontLoader.cpp | ||
GuiFontLoader.h | ||
GuiFontMetrics.cpp | ||
GuiFontMetrics.h | ||
GuiGraphics.cpp | ||
GuiGraphics.h | ||
GuiGraphicsUi.h | ||
GuiHSpace.cpp | ||
GuiHSpace.h | ||
GuiHyperlink.cpp | ||
GuiHyperlink.h | ||
GuiIdListModel.cpp | ||
GuiIdListModel.h | ||
GuiImage.cpp | ||
GuiImage.h | ||
GuiInclude.cpp | ||
GuiInclude.h | ||
GuiIndex.cpp | ||
GuiIndex.h | ||
GuiIndices.cpp | ||
GuiIndices.h | ||
GuiInfo.cpp | ||
GuiInfo.h | ||
GuiKeySymbol.cpp | ||
GuiKeySymbol.h | ||
GuiLabel.cpp | ||
GuiLabel.h | ||
GuiLine.cpp | ||
GuiLine.h | ||
GuiListings.cpp | ||
GuiListings.h | ||
GuiLog.cpp | ||
GuiLog.h | ||
GuiMathMatrix.cpp | ||
GuiMathMatrix.h | ||
GuiNomenclature.cpp | ||
GuiNomenclature.h | ||
GuiNote.cpp | ||
GuiNote.h | ||
GuiPainter.cpp | ||
GuiPainter.h | ||
GuiParagraph.cpp | ||
GuiParagraph.h | ||
GuiPhantom.cpp | ||
GuiPhantom.h | ||
GuiPrefs.cpp | ||
GuiPrefs.h | ||
GuiPrintindex.cpp | ||
GuiPrintindex.h | ||
GuiPrintNomencl.cpp | ||
GuiPrintNomencl.h | ||
GuiProgress.cpp | ||
GuiProgress.h | ||
GuiProgressView.cpp | ||
GuiProgressView.h | ||
GuiRef.cpp | ||
GuiRef.h | ||
GuiSearch.cpp | ||
GuiSearch.h | ||
GuiSelection.cpp | ||
GuiSelection.h | ||
GuiSelectionManager.cpp | ||
GuiSelectionManager.h | ||
GuiSendto.cpp | ||
GuiSendto.h | ||
GuiSetBorder.cpp | ||
GuiSetBorder.h | ||
GuiShowFile.cpp | ||
GuiShowFile.h | ||
GuiSpellchecker.cpp | ||
GuiSpellchecker.h | ||
GuiSymbols.cpp | ||
GuiSymbols.h | ||
GuiTabular.cpp | ||
GuiTabular.h | ||
GuiTabularCreate.cpp | ||
GuiTabularCreate.h | ||
GuiTexinfo.cpp | ||
GuiTexinfo.h | ||
GuiThesaurus.cpp | ||
GuiThesaurus.h | ||
GuiToc.cpp | ||
GuiToc.h | ||
GuiToolbar.cpp | ||
GuiToolbar.h | ||
GuiView.cpp | ||
GuiView.h | ||
GuiViewSource.cpp | ||
GuiViewSource.h | ||
GuiVSpace.cpp | ||
GuiVSpace.h | ||
GuiWorkArea_Private.h | ||
GuiWorkArea.cpp | ||
GuiWorkArea.h | ||
GuiWrap.cpp | ||
GuiWrap.h | ||
IconPalette.cpp | ||
IconPalette.h | ||
InGuiThread.cpp | ||
InGuiThread.h | ||
InsertTableWidget.cpp | ||
InsertTableWidget.h | ||
InsetParamsDialog.cpp | ||
InsetParamsDialog.h | ||
InsetParamsWidget.cpp | ||
InsetParamsWidget.h | ||
LaTeXHighlighter.cpp | ||
LaTeXHighlighter.h | ||
LayoutBox.cpp | ||
LayoutBox.h | ||
LengthCombo.cpp | ||
LengthCombo.h | ||
LyXFileDialog.cpp | ||
LyXFileDialog.h | ||
LyXToolBox.cpp | ||
LyXToolBox.h | ||
Makefile.am | ||
Menus.cpp | ||
Menus.h | ||
PanelStack.cpp | ||
PanelStack.h | ||
qt_helpers.cpp | ||
qt_helpers.h | ||
qt_i18n.h | ||
README | ||
TocModel.cpp | ||
TocModel.h | ||
TocWidget.cpp | ||
TocWidget.h | ||
Toolbars.cpp | ||
Toolbars.h | ||
ToolTipFormatter.cpp | ||
ToolTipFormatter.h | ||
Validator.cpp | ||
Validator.h |
This file contains some do's and dont's for the Qt4 frontend. General rules ------------- Every editable field that affects the state of the dialog contents from LyX's point of view should connect its xxxChanged() signal to a the dialog's changed_adaptor() slot, which in turn should call changed(). If you are using a more complicated thing anyway, then remember to call changed() at the end (if it has changed!) Every non-trivial widget should have a tooltip. If you don't know what to write, write "FIXME", and it can fixed later. Don't be afraid to use QWhatsThis too, but this must be done in the derived class's constructor, and use _("..."). Non-trivial means that things like "OK" /must not/ have a tooltip. moc needs a fully qualified "std::string" for .connect() statements to work. Be very, very careful. Remember to check tab order on a dialog (third icon, with blue bars in designer). Remember to check sensible resizing behaviour on a dialog. This is usually done by adding a top-level layout to the dialog in Designer. Remember to use Edit->Check Accelerators If necessary, you should override Qt2Base::isValid() for determining the validity of the current dialog's contents. OK/Apply/Restore/Close should be connected in the derived class's constructor to call slotOK() etc. Refer to close/cancel as close in the source. Override update_contents() to update the dialog, not update(). Only these functions may change dialog widgets that may emit changed() during initialisation, to prevent the button controller from changing its state. Never call buttoncontroller functions directly from dialogs. In general, you should use Qt2Base::changed() in all circumstances. However, if you must call the buttoncontroller, make sure to respect Qt2Base::updating_ Naming conventions ------------------ QFoo.{cpp,h} The file that interacts with the controller _and_ the implementation of the dialog, derived from the generated files ui/FooDialog.ui The designer file ui_FooDialog.h Generated files from FooDialog.ui slots should be named e.g. slotFooClicked(), slotFooSelected(), where foo is the name of the widget. Widgets should be named like "fooXX", where XX is one of the following widget types : CB - check box CO - combo box ED - line edit GB - group box LA - label LC - LengthCombo LV - QListView ML - QTextBrowser PB - push button RB - radio button SB - spin box SL - slider TE - text edit TW - tree widget (FIXME: also TV in some files) Qt, Unicode, and LyX -------------------- LyX uses a different encoding (UCS4) than Qt (UTF16), therefore there are a number of conversion functions in qt_helpers.{cpp,h}. Read the doxygen documentation for details when to use which function. Additionally, you should follow these simple rules : o Use qt_() not _() in code o Use the conversion functions of qt_helpers.h, NOT .latin1() / .c_str() etc.