Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed issue ninja-ide#856
  • Loading branch information
malderete committed Feb 13, 2013
1 parent 2cd1e02 commit a59b2c1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 9 additions & 0 deletions ninja_ide/core/settings.py
Expand Up @@ -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'
Expand All @@ -39,10 +44,14 @@
FONT_SIZE = 11
OS_KEY = QKeySequence(Qt.CTRL).toString(QKeySequence.NativeText)
EOL_DEFAULT = 'Mac'
IS_MAC = True
IS_LINUX = False
elif sys.platform == "win32":
FONT_FAMILY = 'Courier'
FONT_SIZE = 10
EOL_DEFAULT = 'Windows'
IS_WINDOWS = True
IS_LINUX = False

###############################################################################
# IDE
Expand Down
9 changes: 7 additions & 2 deletions ninja_ide/gui/explorer/tree_projects_widget.py
Expand Up @@ -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)
Expand Down

0 comments on commit a59b2c1

Please sign in to comment.