Commit Graph

107 Commits

Author SHA1 Message Date
John Beard 0be9667c96 Add read-only option for hotkey list, use for list dialog
This replaces the flat HTML list dialog with a read-only
version of the editor dialog in a pared-down dialog.

Fixes: lp:1778374
* https://bugs.launchpad.net/kicad/+bug/1778374
2018-10-04 07:47:21 -04:00
Maciej Suminski b39bde0f0c Specify string size when creating wxString from const char*
wxString constructor will determine string length using strlen() when it
is not explicitly specified, but there is no termination byte added when
reading file contents to 'buffer' variable.
2018-09-14 10:13:45 +02:00
jean-pierre charras 6fdc5972f8 Better fix for accelerator menus using "Back" (previously named "BkSp") key
Use the wxWidgets official accelerator key string for WXK_BACK (this is "Back") in menuitems instead of "BkSp"
Also when reading the hotkey config file, avoid to set a hotkey to unassigned when its name is not found in list.
The default value is used.
Unassigned hotkey use <unassigned> as key name (and 0 as key code) in file.
2018-08-16 15:56:13 +02:00
jean-pierre charras 78ab5c3f07 Fix ASCII code used in accelerator menus for BkSp key (Linux only)
On Linux (GTK?) the accelerator key BkSp, when used in menus must be coded as "\t\b" and not "\tBkSp".
However, On Windows, it must be "\tBkSp".
Joys of multi-platform development.
2018-08-09 17:55:08 +02:00
Jeff Young 7841f8a466 Unified preferences dialog framework.
(cherry picked from commit 8ee3e77)
2018-07-17 15:11:17 +01:00
Seth Hillbrand 4af699e919 hotkeys: Don't import v4 hotkeys automatically
Hotkey options have shifted some options from context-specific to global
hotkeys.  This causes conflicts with old hotkey definitions.  Instead,
we keep the v5 eeschema/pcbnew hotkeys completely separate.  Users can
still import their custom hotkey files from v4.

Fixes: lp:1778408
* https://bugs.launchpad.net/kicad/+bug/1778408
2018-06-29 11:20:11 -07:00
Seth Hillbrand d62b4f36a6 Save hotkeys to combined app-based file
Unifies the different sections of hotkeys so that we are not storing two
[eeschema] or [pcbnew] sections in two different files.

Previous hotkey definitions are loaded at start if they exist but are
overwritten by the new format, if it exists.  Changes to hotkeys save
only in the combined format.

Hotkey editor for each application only shows the hotkeys relevant to
that application.

Fixes: lp:1741757
* https://bugs.launchpad.net/kicad/+bug/1741757

Fixes: lp:1668799
* https://bugs.launchpad.net/kicad/+bug/1668799
2018-05-18 12:57:38 -07:00
Seth Hillbrand d22fceca7c Revert hotkey save format
This reverts the hotkeys file format to a human readable and VCS
compatible listing by splitting individual hotkey assignments onto
separate lines instead of the single key. This unifies the hotkey format
between the application configuration and export Hotkey routines.

Both hotkey formats remain readable by the same routines.
2018-05-18 12:53:45 -07:00
Jeff Young 1afbfad44a Use "..." uniformly in menus.
See the bug report for some wording changes and a couple of
menu restructurings that were also cleaned up.

Fixes: lp:1597827
* https://bugs.launchpad.net/kicad/+bug/1597827
2018-02-10 17:32:28 -05:00
jean-pierre charras 5d72aebd22 Fix code after renaming files 2018-01-29 16:40:22 +01:00
jean-pierre charras 47dfabc6c8 Add size control to HTML_MESSAGE_BOX. Fix incorrect default size of a few dialogs.
Clean code: remove useless code and not used parameters.
2018-01-11 10:48:52 +01:00
Maciej Suminski ea9b568743 Formatting fixes for the previous commit 2018-01-08 12:52:17 +01:00
Dan Weatherill efed38ad3e Fix hotkey import persistence
Fixes: lp:1738875

This patch saves hotkeys to default file when a hotkeys file is
imported, so they remain persistent in future sessions.

Also, a few minor tidy ups (e.g. c++11 nullptr) internal to
common/hotkeys_basic.cpp.
2018-01-08 11:43:01 +01:00
Fabrizio Tappero ac9a64a173 general UI fix. Fixed a lot of icons and a lot of menu.
Also a few no longer used .cpp icon files are removed.
2017-06-02 11:51:11 +02:00
Maciej Suminski 94d8e1e69c Fixed a memleak in ReadHotkeyConfig() 2017-03-04 08:38:35 +01:00
Chris Pavlina 81144c2476 Move hotkey list from Preferences menu to Help menu 2016-06-11 21:22:13 -04:00
jean-pierre charras 713e8d93f3 About dialog: small changes. EDA_HOTKEY class: better ctor. 2016-03-29 19:51:53 +02:00
unknown 0cd747668f Hotkeys Editor has now a "reset to default" button 2016-03-29 18:35:24 +02:00
Wayne Stambaugh a6a9d8eedf Default and most recently used path fixes. (fixes: 1494210)
* Rename Eda_FileSelector to EDA_FILE_SELECTOR.
* Add optional pointer to wxString to save the most recently used path to EDA_FILE_SELECTOR.
* Rename Eda_DirectorySelector to EDA_PATH_SELECTOR.
* Replace wxGetCwd() with wxStandardPaths::GetDocumentsDir().  This fixes the windows issue
  where wxGetCwd() returns the path where the executable files are located.
* Add code to handle most recently used path to EDA_BASE_FRAME.
* Fix string formatting error in kicad/files-io.cpp.
* Remove setting and restoring current working directory when launching GerbView.  Setting the CWD
  has no effect on the launched executable which starts with it's own CWD.
* Allow project path to be passed to GerbView when launched from KiCad.
* Note: this is a work in progress.  Do not expect every path and/or file selection dialog to properly
  update the most recently used path.  The correct solution to this problem requires a much more
  well though out solution which will not happen until after the next stable release.
2015-09-25 15:38:09 -04:00
Chris Pavlina b55c074a11 Interpret unassigned hotkeys correctly.
* If a hotkey is set to "unassigned" (typically by causing a conflict), it 
  is not loaded correctly. The loader interprets "unassigned" as "keep the 
  default assignment", which leads to a conflict later that causes an 
  assertion failure.
2015-09-07 16:04:16 -04:00
Wayne Stambaugh 0cff6444e0 Fix assertion when exporting hotkeys. (fixes lp:1479859)
* wxFD_SAVE and wxFD_OPEN cannot be specified when calling wxFileDialog.  it even says so in
  the documentation.
2015-08-01 17:46:27 -04:00
jean-pierre charras 8d5ee67c9c New attempt to manage the Cmd key on OSX in menus. 2015-07-04 10:36:58 +02:00
jean-pierre charras 5c7f073a28 Hotkeys: try to use Cmd instead of Ctrl on Mac OSX. 2015-07-02 09:28:54 +02:00
Maciej Suminski da75c52665 Hot keys settings are synchronized between GAL & legacy 2015-05-05 20:39:42 +02:00
jean-pierre charras 4daf9039db Eeschema: Fix a very old bug relative to the tool to load power parts:
Previously, only the lib named "power" was used (and therefore power parts defined in other libs not shown).
Now, all power parts can be loaded from any library.
Also, when loading power parts from the chose component dialog or the lib viewer, libs and parts are filtered:  only power parts and libs containing power parts are listed.
Hotkeys: move a few global strings in the files where ther are actually used (and make them local.) and code cleaning.
Fix a few other minor issues.
2015-04-16 17:26:51 +02:00
jean-pierre charras 9c0c89256e Make hotkeys editor titles translatable. 2015-04-14 19:44:19 +02:00
jean-pierre charras 0e03fbff07 Make hotkey string info translatable in dialogs. These strings are now prefixed by _HKI , which can be used by translation tools to extract them. 2015-03-22 15:04:09 +01:00
jean-pierre charras 3c4f76abe4 Fix a not shown dialog under XFCE and Unity. Make display hotkeys window not modal. 2015-03-15 12:41:06 +01:00
jean-pierre charras c7d04c3d08 Code cleaning: Remove EDA_BASE_FRAME::m_FrameName member which is a duplicate of wxFrame name. 2015-03-03 15:53:47 +01:00
jean-pierre charras 2804d2e566 Add hotkeys to Kicad manager, and some rework on hotkeys management. 2015-03-02 18:29:18 +01:00
jean-pierre charras 30c7821ba2 Grebview: add info in layer manager for Excellon drill filles, similar to X2 file function info in X2 gerber files. 2014-11-23 12:41:57 +01:00
Garth Corral 5c3cc11ed5 Fix debug assertion when clicking on hot key menu. (fixes lp:1389932) 2014-11-06 15:56:34 -05:00
Mark Roszko 816974b8ca Hot key editor dialog improvemnts.
* Change hot key editing contol from wxGridTableBase to wxListCtrl.
* Separate hot key lists into separate tabs rather than one large list.
* Coding policy fixes.
2014-10-17 10:36:47 -04:00
Mark Roszko 606f2e91f8 Make hotkey command titles use consistent capitalization.
Rename "Switch highcontrast" to "Toggle High Contrast".
Eliminate most of the abbreviated hotkey titles.
Doxygenize dialog_hotkeys_editor.h and add missing license block.
Display <unassigned> if key code is 0 (NULL).
2014-10-15 21:17:51 -04:00
Mark Roszko 651a92a80f Hotkey Editor Polishing
Refactor hotkey editor to use tab control instead of one giant list.
Each tab is a separate hotkey section.
Modify EDA_HOTKEY_CONFIG to change the m_Comment member to m_Title for a new purpose.
We want a pretty title in the hotkey editor. We use m_Title for the key export comment which
still conveys the purpose just as easily.
Refactored usage of wxGrid into wxListCtrl which allows capturing navigation characters
and also works better (single selection is built in).
Add hotkey overwrite prompts that are paired with "Common" section. It will check if a hotkey
overlaps with the proper sections. i.e. Common with the all other sections; or Section 1 with just Common.
Right-click menu removed due to wxListCtrl being able to catch the special keys properly.
2014-10-15 21:17:46 -04:00
Moses McKnight 6da5e2cdd0 Configuration file consolidation patch from Moses McKnight.
* Create GetNewConfig() and GetKicadConfigPath() to unify configuration file
  creation and location.
* Move Windows configuration out of the registry into configuration files.
* Move Linux configuration files from $HOME to $HOME/.config/kicad to eliminate
  configuration file pollution in the users $HOME folder.
* Fix a bug in the configuration file where the Eeschema hot keys are saved.
2014-09-05 17:12:38 -04:00
Dick Hollenbeck 7e483f69bd Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
     get disassociated from their true PROJECT.
  *) Allow loading eeschema library editor from kicad.exe
  *) Allow loading pcbnew library editor from kicad.exe
  *) Rename LIB_COMPONENT to LIB_PART.
  *) Add class PART_LIBS, and PART_LIB.
  *) Make PART_LIBS non-global, i.e. PROJECT specific.
  *) Implement "data on demand" for PART_LIBS
  *) Implement "data on demand" for schematic SEARCH_STACK.
  *) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
  *) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
     a weak pointer.
  *) Remove all chdir() calls so projects don't need to be CWD.
  *) Romove APPEND support from OpenProjectFiles().
  *) Make OpenProjectFiles() robust, even for creating new projects.
  *) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
     and save them in the .eeschema config file, not in the project file.
  *) Fix bug with wxDir() while accessing protected dirs in kicad.exe
  *) Consolidate template copying into PROJECT class, not in kicad.exe source.
  *) Generally untangle eeschema, making its libraries not global but rather
     held in the PROJECT.
2014-08-13 15:28:54 -05:00
jean-pierre charras 9b99ac2a53 All: add 2 hotkeys to simulate a mouse left click (key return) and left dclick (key end) 2014-04-03 09:40:55 +02:00
Dick Hollenbeck 2c67c3ff80 * KIWAY Milestone A): Make major modules into DLL/DSOs.
!   The initial testing of this commit should be done using a Debug build so that
    all the wxASSERT()s are enabled.  Also, be sure and keep enabled the
    USE_KIWAY_DLLs option.  The tree won't likely build without it.  Turning it
    off is senseless anyways.  If you want stable code, go back to a prior version,
    the one tagged with "stable".

*   Relocate all functionality out of the wxApp derivative into more finely
    targeted purposes:
    a) DLL/DSO specific
    b) PROJECT specific
    c) EXE or process specific
    d) configuration file specific data
    e) configuration file manipulations functions.

    All of this functionality was blended into an extremely large wxApp derivative
    and that was incompatible with the desire to support multiple concurrently
    loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
    An amazing amount of organization come from simply sorting each bit of
    functionality into the proper box.

*   Switch to wxConfigBase from wxConfig everywhere except instantiation.
*   Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
    PGM_SINGLE_TOP,
*   Remove "Return" prefix on many function names.
*   Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
*   Fix building boost for use in a DSO on linux.
*   Remove some of the assumptions in the CMakeLists.txt files that windows had
    to be the host platform when building windows binaries.
*   Reduce the number of wxStrings being constructed at program load time via
    static construction.
*   Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
    these functions are useful even when the wxConfigBase comes from another
    source, as is the case in the KICAD_MANAGER_FRAME.
*   Move the setting of the KIPRJMOD environment variable into class PROJECT,
    so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
*   Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
    its child wxFrames and wxDialogs now have a Kiway() member function which
    returns a KIWAY& that that window tree branch is in support of.  This is like
    wxWindows DNA in that child windows get this member with proper value at time
    of construction.
*   Anticipate some of the needs for milestones B) and C) and make code
    adjustments now in an effort to reduce work in those milestones.
*   No testing has been done for python scripting, since milestone C) has that
    being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
jean-pierre charras f956fbd8ac painter: better size of pad nums and pad netnames in opengl mode 2013-11-04 18:18:19 +01:00
jean-pierre charras d5ecafd5af Fix some minor issues in hotkey dialogs 2013-09-21 19:09:08 +02:00
jean-pierre charras 1f3f11ca0d Add margin values control in pl_editor, and remove margin definition from class PAGE_INFO. 2013-07-20 21:36:19 +02:00
jean-pierre charras 91c3f3bc83 All: use a S expression to describe the page layout (title block and grid references). Work in progress.
This should  allow users to define their own page layout.
2013-06-05 14:03:16 +02:00
Matthew Beckler 088832b8f6 Match 'new char[]' with proper delete[] char* rather than delete char*. 2013-04-13 23:07:04 -05:00
jean-pierre charras 8f62c6aa05 Move AddMenuItem inline functions outside wxstruct.h in a new file (menu_helpers.h)
Enhancements in AddMenuItem (that accepts now a menu type)
Partial use of the Edwin van den Oetelaar's patch (patch not fully working or correct)
2012-04-09 11:16:47 +02:00
Dick Hollenbeck b8a0ab4c52 switch to <> for includes from "" per conversation with Jean-Pierre and Wayne, adjust search paths 2012-01-22 22:33:36 -06:00
jean-pierre charras 7c17187052 Pcbnew: Fix typo in 2 filenames. Add comments in ratsnest.cpp.
Fix bug 887202.
2011-11-07 19:04:19 +01:00
Wayne Stambaugh b98b23a1a6 Factor Eeschema rotate item hot keys into a rotate event handler.
* Add a rotate event handler to schematic frame object.
* Remove unique rotate item command IDs.
* Use process event instead of post event to eliminate the need to clean
  up the command event client object from the heap.
* Unify find next item and next DRC error hot key commands.
* Unify move and rotate hot keys commands.
2011-10-26 16:46:04 -04:00
Wayne Stambaugh 1bd7fc8a4e Minor menu bar fixes.
* Fixed bug on Windows that prevented the menu short cuts from working
  properly.
* Fix duplicate menu short cut keys in KiCad, Pcbnew, and Eeschema.
* Add menu short cuts for all possible menu entries.
2011-10-18 15:59:19 -04:00
Wayne Stambaugh 4b853dedb4 Application name capitalization fixes.
* Correct all user strings and comments for the correct capitalization of
  application names according to JP.  They are KiCad, Pcbnew, CvPcb,
  Eeschema, and GerbView.
* Add a note the the user interface policy about the correct capitalization.
2011-09-30 14:15:37 -04:00