Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge and replace pep8mod patch using new settings utility functions

  • Loading branch information...
commit 125e6201ce34234b43311d3f90177bb75f7db8cd 2 parents af71f3a + a59b2c1
@malderete authored
View
13 ninja_ide/core/settings.py
@@ -26,6 +26,11 @@
# OS DETECTOR
###############################################################################
+# Use this flags instead of sys.platform spreaded in the source code
+IS_WINDOWS = False
+IS_MAC = False
+IS_LINUX = True
+
OS_KEY = "Ctrl"
FONT_FAMILY = 'Monospace'
@@ -37,9 +42,13 @@
FONT_FAMILY = 'Monaco'
FONT_SIZE = 11
OS_KEY = QKeySequence(Qt.CTRL).toString(QKeySequence.NativeText)
+ IS_MAC = True
+ IS_LINUX = False
elif sys.platform == "win32":
FONT_FAMILY = 'Courier'
FONT_SIZE = 10
+ IS_WINDOWS = True
+ IS_LINUX = False
###############################################################################
# IDE
@@ -424,8 +433,8 @@ def load_settings():
'preferences/editor/showTabsAndSpaces', 'true') == 'true'
USE_TABS = qsettings.value('preferences/editor/useTabs', 'false') == 'true'
if USE_TABS:
- pep8mod.options.ignore.append("W191")
- pep8mod.refresh_checks()
+ pep8mod_add_ignore("W191")
+ pep8mod_refresh_checks
ALLOW_WORD_WRAP = qsettings.value(
'preferences/editor/allowWordWrap', 'false') == 'true'
COMPLETE_DECLARATIONS = qsettings.value(
View
9 ninja_ide/gui/explorer/tree_projects_widget.py
@@ -109,8 +109,13 @@ def __init__(self, state_index=list()):
self.connect(self, SIGNAL(
"customContextMenuRequested(const QPoint &)"),
self._menu_context_tree)
- self.connect(self, SIGNAL("itemClicked(QTreeWidgetItem *, int)"),
- self._open_file)
+
+ signal_name = "itemClicked(QTreeWidgetItem *, int)"
+ # For windows double click instead of single click
+ if settings.IS_WINDOWS:
+ signal_name = "itemDoubleClicked(QTreeWidgetItem *, int)"
+
+ self.connect(self, SIGNAL(signal_name), self._open_file)
self.connect(self._fileWatcher, SIGNAL("fileChanged(int, QString)"),
self._refresh_project_by_path)
self.itemExpanded.connect(self._item_expanded)
Please sign in to comment.
Something went wrong with that request. Please try again.