diff libgui/src/resource-manager.cc @ 20125:6049bdfa8d56

make notepad++ the custom default editor in windows * default-qt-settings.in: use a placeholder for the custom editor * file-editor.cc (call_custom_editor): set a default for the preference for using a custom editor * resource-manager.cc (do_reload_settings): replace the placeholders by the appropriate string depending on the platform * settings-dialog.ui: remove the hard coded string from the settings dialog
author Torsten <ttl@justmail.de>
date Sun, 08 Mar 2015 09:48:45 +0100
parents a8a5415b05cb
children 7ac907da9fba
line wrap: on
line diff
--- a/libgui/src/resource-manager.cc
+++ b/libgui/src/resource-manager.cc
@@ -191,7 +191,7 @@
       QString settings_text = in.readAll ();
       qt_settings.close ();
 
-      // Get the default monospaced font and replace placeholder
+      // Get the default monospaced font
 #if defined (HAVE_QFONT_MONOSPACE)
       QFont fixed_font;
       fixed_font.setStyleHint (QFont::Monospace);
@@ -203,6 +203,16 @@
 #else
       QString default_family = "courier";
 #endif
+
+      // Get the default custom editor
+#if defined (Q_OS_WIN32)
+      QString custom_editor = "notepad++ -n%l %f";
+#else
+      QString custom_editor = "emacs +%l %f";
+#endif
+
+      // Replace placeholders
+      settings_text.replace ("__default_custom_editor__", custom_editor);
       settings_text.replace ("__default_font__", default_family);
       settings_text.replace ("__default_font_size__", "10");