Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: malderete/ninja-ide
base: 191d5a9108
...
head fork: malderete/ninja-ide
compare: 166eab1df8
  • 5 commits
  • 20 files changed
  • 0 commit comments
  • 3 contributors
6 ninja_ide/core/settings.py
View
@@ -28,8 +28,6 @@
# Use this flags instead of sys.platform spreaded in the source code
IS_WINDOWS = False
-IS_MAC = False
-IS_LINUX = True
OS_KEY = "Ctrl"
@@ -42,13 +40,11 @@
FONT_FAMILY = 'Monaco'
FONT_SIZE = 11
OS_KEY = QKeySequence(Qt.CTRL).toString(QKeySequence.NativeText)
- IS_MAC = True
- IS_LINUX = False
+ EOL_DEFAULT = 'Mac'
elif sys.platform == "win32":
FONT_FAMILY = 'Courier'
FONT_SIZE = 10
IS_WINDOWS = True
- IS_LINUX = False
###############################################################################
# IDE
8 ninja_ide/gui/actions.py
View
@@ -464,7 +464,7 @@ def _add_file_to_project(self, path):
editorWidget._file_saved()
except file_manager.NinjaFileExistsException as ex:
QMessageBox.information(self, self.tr("File Already Exists"),
- self.tr("Invalid Path: the file '%s' already exists." %
+ (self.tr("Invalid Path: the file '%s' already exists.") %
ex.filename))
def add_project_to_console(self, projectFolder):
@@ -561,10 +561,10 @@ def count_file_code_lines(self):
blanks = re.findall('(^\n)|(^(\s+)?#)|(^( +)?($|\n))',
editorWidget.get_text(), re.M)
blanks_count = len(blanks)
- resume = self.tr("Lines code: %s\n" % (block_count - blanks_count))
- resume += self.tr("Blanks and commented lines: %s\n\n" %
+ resume = self.tr("Lines code: %s\n") % (block_count - blanks_count)
+ resume += (self.tr("Blanks and commented lines: %s\n\n") %
blanks_count)
- resume += self.tr("Total lines: %s" % block_count)
+ resume += self.tr("Total lines: %s") % block_count
msgBox = QMessageBox(QMessageBox.Information,
self.tr("Summary of lines"), resume,
QMessageBox.Ok, editorWidget)
4 ninja_ide/gui/central_widget.py
View
@@ -217,11 +217,11 @@ def __init__(self, explorer):
self.style().standardPixmap(self.style().SP_TrashIcon))
self.combo.setToolTip(self.trUtf8("Select the item from the Paste "
"Historial list.\nYou can Copy items into this list with: "
- "%s\nor Paste them using: %s" %
+ "%s\nor Paste them using: %s") %
(resources.get_shortcut("History-Copy").toString(
QKeySequence.NativeText),
resources.get_shortcut("History-Paste").toString(
- QKeySequence.NativeText))))
+ QKeySequence.NativeText)))
self.combo.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
hbox.addWidget(self.combo)
vbox.addLayout(hbox)
10 ninja_ide/gui/dialogs/about_ninja.py
View
@@ -65,17 +65,17 @@ def __init__(self, parent=None):
to build Python Applications.
NINJA-IDE provides tools to simplify the Python-software development
and handles all kinds of situations thanks to its rich extensibility.""")))
- vbox.addWidget(QLabel(self.tr("Version: %s" % ninja_ide.__version__)))
+ vbox.addWidget(QLabel(self.tr("Version: %s") % ninja_ide.__version__))
link_ninja = QLabel(
self.tr('Website: <a href="%s"><span style=" '
'text-decoration: underline; color:#ff9e21;">'
- '%s</span></a>' %
- (ninja_ide.__url__, ninja_ide.__url__)))
+ '%s</span></a>') %
+ (ninja_ide.__url__, ninja_ide.__url__))
vbox.addWidget(link_ninja)
link_source = QLabel(
self.tr('Source Code: <a href="%s"><span style=" '
- 'text-decoration: underline; color:#ff9e21;">%s</span></a>' %
- (ninja_ide.__source__, ninja_ide.__source__)))
+ 'text-decoration: underline; color:#ff9e21;">%s</span></a>') %
+ (ninja_ide.__source__, ninja_ide.__source__))
vbox.addWidget(link_source)
self.connect(link_ninja, SIGNAL("linkActivated(QString)"),
94 ninja_ide/gui/dialogs/preferences.py
View
@@ -955,51 +955,55 @@ class EditorConfiguration(QWidget):
def __init__(self):
QWidget.__init__(self)
- grid = QGridLayout(self)
+ vbox = QVBoxLayout(self)
#Indentation
groupBoxFeatures = QGroupBox(self.tr("Features:"))
- grid.addWidget(groupBoxFeatures, 0, 0, alignment=Qt.AlignTop)
- grid.addWidget(QLabel(
+ formFeatures = QGridLayout(groupBoxFeatures)
+ formFeatures.addWidget(QLabel(
self.tr("Indentation Length:")), 1, 0, Qt.AlignRight)
self._spin = QSpinBox()
self._spin.setAlignment(Qt.AlignRight)
self._spin.setMinimum(1)
self._spin.setValue(settings.INDENT)
- grid.addWidget(self._spin, 1, 1, alignment=Qt.AlignTop)
+ formFeatures.addWidget(self._spin, 1, 1, alignment=Qt.AlignTop)
self._checkUseTabs = QCheckBox(
self.tr("Use Tabs."))
self._checkUseTabs.setChecked(settings.USE_TABS)
self.connect(self._checkUseTabs, SIGNAL("stateChanged(int)"),
self._change_tab_spaces)
- grid.addWidget(self._checkUseTabs, 1, 2, alignment=Qt.AlignTop)
+ formFeatures.addWidget(self._checkUseTabs, 1, 2, alignment=Qt.AlignTop)
if settings.USE_TABS:
self._spin.setSuffix(self.tr(" (tab size)"))
else:
self._spin.setSuffix(self.tr(" (spaces)"))
#Margin Line
- grid.addWidget(QLabel(self.tr("Margin Line:")), 2, 0, Qt.AlignRight)
+ formFeatures.addWidget(QLabel(self.tr("Margin Line:")), 2, 0,
+ Qt.AlignRight)
self._spinMargin = QSpinBox()
self._spinMargin.setMaximum(200)
self._spinMargin.setValue(settings.MARGIN_LINE)
- grid.addWidget(self._spinMargin, 2, 1, alignment=Qt.AlignTop)
+ formFeatures.addWidget(self._spinMargin, 2, 1, alignment=Qt.AlignTop)
self._checkShowMargin = QCheckBox(self.tr("Show Margin Line"))
self._checkShowMargin.setChecked(settings.SHOW_MARGIN_LINE)
- grid.addWidget(self._checkShowMargin, 2, 2, alignment=Qt.AlignTop)
+ formFeatures.addWidget(self._checkShowMargin, 2, 2,
+ alignment=Qt.AlignTop)
#End of line
self._checkEndOfLine = QCheckBox(self.tr("Use Platform End of Line"))
self._checkEndOfLine.setChecked(settings.USE_PLATFORM_END_OF_LINE)
- grid.addWidget(self._checkEndOfLine, 3, 1, alignment=Qt.AlignTop)
+ formFeatures.addWidget(self._checkEndOfLine, 3, 1,
+ alignment=Qt.AlignTop)
#Find Errors
self._checkHighlightLine = QCheckBox(
self.tr("Check: Highlight errors using Underline\n"
"Uncheck: Highlight errors using Background"))
self._checkHighlightLine.setChecked(settings.UNDERLINE_NOT_BACKGROUND)
- grid.addWidget(self._checkHighlightLine, 4, 1, 1, 2,
+ formFeatures.addWidget(self._checkHighlightLine, 4, 1, 1, 2,
alignment=Qt.AlignTop)
self._checkErrors = QCheckBox(self.tr("Find and Show Errors."))
self._checkErrors.setChecked(settings.FIND_ERRORS)
- grid.addWidget(self._checkErrors, 5, 1, 1, 2, alignment=Qt.AlignTop)
+ formFeatures.addWidget(self._checkErrors, 5, 1, 1, 2,
+ alignment=Qt.AlignTop)
self.connect(self._checkErrors, SIGNAL("stateChanged(int)"),
self._disable_show_errors)
self._showErrorsOnLine = QCheckBox(
@@ -1007,12 +1011,13 @@ def __init__(self):
self._showErrorsOnLine.setChecked(settings.ERRORS_HIGHLIGHT_LINE)
self.connect(self._showErrorsOnLine, SIGNAL("stateChanged(int)"),
self._enable_errors_inline)
- grid.addWidget(self._showErrorsOnLine, 6, 2, 1, 1, Qt.AlignTop)
+ formFeatures.addWidget(self._showErrorsOnLine, 6, 2, 1, 1, Qt.AlignTop)
#Find Check Style
self._checkStyle = QCheckBox(
self.tr("Find and Show Check Style errors."))
self._checkStyle.setChecked(settings.CHECK_STYLE)
- grid.addWidget(self._checkStyle, 7, 1, 1, 2, alignment=Qt.AlignTop)
+ formFeatures.addWidget(self._checkStyle, 7, 1, 1, 2,
+ alignment=Qt.AlignTop)
self.connect(self._checkStyle, SIGNAL("stateChanged(int)"),
self._disable_check_style)
self._checkStyleOnLine = QCheckBox(
@@ -1020,37 +1025,44 @@ def __init__(self):
self._checkStyleOnLine.setChecked(settings.CHECK_HIGHLIGHT_LINE)
self.connect(self._checkStyleOnLine, SIGNAL("stateChanged(int)"),
self._enable_check_inline)
- grid.addWidget(self._checkStyleOnLine, 8, 2, 1, 1, Qt.AlignTop)
+ formFeatures.addWidget(self._checkStyleOnLine, 8, 2, 1, 1, Qt.AlignTop)
# Python3 Migration
self._showMigrationTips = QCheckBox(
self.tr("Show Python3 Migration Tips."))
self._showMigrationTips.setChecked(settings.SHOW_MIGRATION_TIPS)
- grid.addWidget(self._showMigrationTips, 9, 1, 1, 2, Qt.AlignTop)
+ formFeatures.addWidget(self._showMigrationTips, 9, 1, 1, 2,
+ Qt.AlignTop)
#Center On Scroll
self._checkCenterScroll = QCheckBox(
self.tr("Center on Scroll."))
self._checkCenterScroll.setChecked(settings.CENTER_ON_SCROLL)
- grid.addWidget(self._checkCenterScroll, 10, 1, 1, 2,
+ formFeatures.addWidget(self._checkCenterScroll, 10, 1, 1, 2,
alignment=Qt.AlignTop)
#Remove Trailing Spaces add Last empty line automatically
self._checkTrailing = QCheckBox(self.tr(
"Remove Trailing Spaces and\nadd Last Line automatically."))
self._checkTrailing.setChecked(settings.REMOVE_TRAILING_SPACES)
- grid.addWidget(self._checkTrailing, 11, 1, 1, 2, alignment=Qt.AlignTop)
+ formFeatures.addWidget(self._checkTrailing, 11, 1, 1, 2,
+ alignment=Qt.AlignTop)
#Show Tabs and Spaces
self._checkShowSpaces = QCheckBox(self.tr("Show Tabs and Spaces."))
self._checkShowSpaces.setChecked(settings.SHOW_TABS_AND_SPACES)
- grid.addWidget(self._checkShowSpaces, 12, 1, 1, 2,
+ formFeatures.addWidget(self._checkShowSpaces, 12, 1, 1, 2,
alignment=Qt.AlignTop)
self._allowWordWrap = QCheckBox(self.tr("Allow Word Wrap."))
self._allowWordWrap.setChecked(settings.ALLOW_WORD_WRAP)
- grid.addWidget(self._allowWordWrap, 13, 1, 1, 2, alignment=Qt.AlignTop)
+ formFeatures.addWidget(self._allowWordWrap, 13, 1, 1, 2,
+ alignment=Qt.AlignTop)
self._checkForDocstrings = QCheckBox(
self.tr("Check for Docstrings in Classes and Functions."))
self._checkForDocstrings.setChecked(settings.CHECK_FOR_DOCSTRINGS)
- grid.addWidget(self._checkForDocstrings, 14, 1, 1, 2,
+ formFeatures.addWidget(self._checkForDocstrings, 14, 1, 1, 2,
alignment=Qt.AlignTop)
+ vbox.addWidget(groupBoxFeatures)
+ vbox.addItem(QSpacerItem(0, 10, QSizePolicy.Expanding,
+ QSizePolicy.Expanding))
+
def _enable_check_inline(self, val):
if val == Qt.Checked:
self._checkStyle.setChecked(True)
@@ -1137,10 +1149,10 @@ class EditorCompletion(QWidget):
def __init__(self):
QWidget.__init__(self)
- grid = QGridLayout(self)
+ vbox = QVBoxLayout(self)
groupBoxClose = QGroupBox(self.tr("Complete:"))
- grid.addWidget(groupBoxClose, 0, 0, alignment=Qt.AlignTop)
+ formClose = QGridLayout(groupBoxClose)
self._checkParentheses = QCheckBox(self.tr("Parentheses: ()"))
self._checkParentheses.setChecked('(' in settings.BRACES)
self._checkKeys = QCheckBox(self.tr("Keys: {}"))
@@ -1153,27 +1165,33 @@ def __init__(self):
self._checkDoubleQuotes.setChecked('"' in settings.QUOTES)
self._checkCompleteDeclarations = QCheckBox(
self.tr("Complete Declarations\n"
- "(execute the opposite action with: %s)." %
+ "(execute the opposite action with: %s).") %
resources.get_shortcut("Complete-Declarations").toString(
- QKeySequence.NativeText)))
+ QKeySequence.NativeText))
self._checkCompleteDeclarations.setChecked(
settings.COMPLETE_DECLARATIONS)
- grid.addWidget(self._checkParentheses, 1, 1, alignment=Qt.AlignTop)
- grid.addWidget(self._checkKeys, 1, 2, alignment=Qt.AlignTop)
- grid.addWidget(self._checkBrackets, 2, 1, alignment=Qt.AlignTop)
- grid.addWidget(self._checkSimpleQuotes, 2, 2, alignment=Qt.AlignTop)
- grid.addWidget(self._checkDoubleQuotes, 3, 1, alignment=Qt.AlignTop)
+ formClose.addWidget(self._checkParentheses, 1, 1,
+ alignment=Qt.AlignTop)
+ formClose.addWidget(self._checkKeys, 1, 2, alignment=Qt.AlignTop)
+ formClose.addWidget(self._checkBrackets, 2, 1, alignment=Qt.AlignTop)
+ formClose.addWidget(self._checkSimpleQuotes, 2, 2,
+ alignment=Qt.AlignTop)
+ formClose.addWidget(self._checkDoubleQuotes, 3, 1,
+ alignment=Qt.AlignTop)
+ vbox.addWidget(groupBoxClose)
groupBoxCode = QGroupBox(self.tr("Code Completion:"))
- grid.addWidget(groupBoxCode, 4, 0, alignment=Qt.AlignTop)
+ formCode = QGridLayout(groupBoxCode)
self._checkCodeDot = QCheckBox(
self.tr("Activate Code Completion with: \".\""))
self._checkCodeDot.setChecked(settings.CODE_COMPLETION)
- grid.addWidget(self._checkCompleteDeclarations, 5, 1,
+ formCode.addWidget(self._checkCompleteDeclarations, 5, 1,
alignment=Qt.AlignTop)
- grid.addWidget(self._checkCodeDot, 6, 1, alignment=Qt.AlignTop)
- grid.addItem(QSpacerItem(0, 10, QSizePolicy.Expanding,
- QSizePolicy.Expanding), 7, 0)
+
+ formCode.addWidget(self._checkCodeDot, 6, 1, alignment=Qt.AlignTop)
+ vbox.addWidget(groupBoxCode)
+ vbox.addItem(QSpacerItem(0, 10, QSizePolicy.Expanding,
+ QSizePolicy.Expanding))
def save(self):
qsettings = QSettings()
@@ -1680,7 +1698,7 @@ def save_scheme(self):
if file_manager.file_exists(fileName):
answer = QMessageBox.question(self,
self.tr("Scheme already exists"),
- self.tr("Do you want to override the file: %s?" % fileName),
+ (self.tr("Do you want to override the file: %s?") % fileName),
QMessageBox.Yes, QMessageBox.No)
if name != '' and answer in (QMessageBox.Yes, True):
@@ -1692,7 +1710,7 @@ def save_scheme(self):
self.original_style = copy.copy(scheme)
json_manager.save_editor_skins(fileName, scheme)
QMessageBox.information(self, self.tr("Scheme Saved"),
- self.tr("The scheme has been saved at: %s." % fileName))
+ (self.tr("The scheme has been saved at: %s.") % fileName))
elif answer == QMessageBox.Yes:
QMessageBox.information(self, self.tr("Scheme Not Saved"),
self.tr("The name probably is invalid."))
@@ -1861,9 +1879,9 @@ def save_stylesheet(self):
content = self.edit_qss.toPlainText()
file_manager.store_file_content(file_name, content, newFile=True)
QMessageBox.information(self, self.tr("Style Sheet Saved"),
- self.tr("Theme saved at: '%s'." % file_name))
+ (self.tr("Theme saved at: '%s'." % file_name)))
self.edit_qss.document().setModified(False)
except file_manager.NinjaFileExistsException as ex:
QMessageBox.information(self, self.tr("File Already Exists"),
- self.tr("Invalid File Name: the file '%s' already exists." %
+ (self.tr("Invalid File Name: the file '%s' already exists.") %
ex.filename))
2  ninja_ide/gui/dialogs/project_properties_widget.py
View
@@ -101,7 +101,7 @@ def save_properties(self):
self._item.pythonPath = self.projectExecution.txtPythonPath.text()
self._item.PYTHONPATH = self.projectExecution.PYTHONPATH.toPlainText()
self._item.additional_builtins = filter(
- lambda e: e, # remove empty names
+ lambda e: e, # remove empty names
self.projectExecution.additional_builtins.text().split(' '))
self._item.preExecScript = self.projectExecution.txtPreExec.text()
self._item.postExecScript = self.projectExecution.txtPostExec.text()
10 ninja_ide/gui/explorer/tree_projects_widget.py
View
@@ -442,7 +442,7 @@ def _add_new_file(self):
mainContainer.open_file(fileName)
except file_manager.NinjaFileExistsException as ex:
QMessageBox.information(self, self.tr("File Already Exists"),
- self.tr("Invalid Path: the file '%s' already exists." %
+ (self.tr("Invalid Path: the file '%s' already exists.") %
ex.filename))
def add_existing_file(self, path):
@@ -537,7 +537,7 @@ def _rename_file(self):
subitem.parent().takeChild(index)
except file_manager.NinjaFileExistsException as ex:
QMessageBox.information(self, self.tr("File Already Exists"),
- self.tr("Invalid Path: the file '%s' already exists." %
+ (self.tr("Invalid Path: the file '%s' already exists.") %
ex.filename))
def _copy_file(self):
@@ -566,7 +566,7 @@ def _copy_file(self):
self.add_existing_file(path)
except file_manager.NinjaFileExistsException as ex:
QMessageBox.information(self, self.tr("File Already Exists"),
- self.tr("Invalid Path: the file '%s' already exists." %
+ (self.tr("Invalid Path: the file '%s' already exists.") %
ex.filename))
def _move_file(self):
@@ -592,7 +592,7 @@ def _move_file(self):
self.add_existing_file(path)
except file_manager.NinjaFileExistsException as ex:
QMessageBox.information(self, self.tr("File Already Exists"),
- self.tr("Invalid Path: the file '%s' already exists." %
+ (self.tr("Invalid Path: the file '%s' already exists.") %
ex.filename))
def _edit_ui_file(self):
@@ -883,4 +883,4 @@ def _unfold_all_projects(self):
"""
Unfold all project
"""
- self._tree.expandAll()
+ self._tree.expandAll()
2  ninja_ide/gui/ide.py
View
@@ -447,7 +447,7 @@ def closeEvent(self, event):
txt = '\n'.join(unsaved_files)
val = QMessageBox.question(self,
self.tr("Some changes were not saved"),
- self.tr("%s\n\nDo you want to save them?" % txt),
+ (self.tr("%s\n\nDo you want to save them?") % txt),
QMessageBox.Yes, QMessageBox.No, QMessageBox.Cancel)
if val == QMessageBox.Yes:
#Saves all open files
6 ninja_ide/gui/main_panel/main_container.py
View
@@ -619,7 +619,7 @@ def save_file(self, editorWidget=None):
encoding = file_manager.get_file_encoding(content)
editorWidget.encoding = encoding
self.emit(SIGNAL("fileSaved(QString)"),
- self.tr("File Saved: %s" % fileName))
+ (self.tr("File Saved: %s") % fileName))
editorWidget._file_saved()
return True
except Exception as reason:
@@ -661,7 +661,7 @@ def save_file_as(self):
self.remove_standalone_watcher(editorWidget.ID)
editorWidget.ID = fileName
self.emit(SIGNAL("fileSaved(QString)"),
- self.tr("File Saved: %s" % fileName))
+ (self.tr("File Saved: %s") % fileName))
self.emit(SIGNAL("currentTabChanged(QString)"), fileName)
editorWidget._file_saved()
self.add_standalone_watcher(fileName)
@@ -670,7 +670,7 @@ def save_file_as(self):
except file_manager.NinjaFileExistsException as ex:
editorWidget.just_saved = False
QMessageBox.information(self, self.tr("File Already Exists"),
- self.tr("Invalid Path: the file '%s' already exists." %
+ (self.tr("Invalid Path: the file '%s' already exists.") %
ex.filename))
except Exception as reason:
editorWidget.just_saved = False
6 ninja_ide/gui/main_panel/tab_widget.py
View
@@ -183,7 +183,7 @@ def _prompt_reload(self, editorWidget, change):
editorWidget.just_saved = False
return
val = QMessageBox.question(self, 'The file has changed on disc!',
- self.tr("%s\nDo you want to reload it?" % editorWidget.ID),
+ (self.tr("%s\nDo you want to reload it?") % editorWidget.ID),
QMessageBox.Yes, QMessageBox.No)
if val == QMessageBox.Yes:
self.emit(SIGNAL("reloadFile(QWidget)"), editorWidget)
@@ -193,7 +193,7 @@ def _prompt_reload(self, editorWidget, change):
elif change == DELETED:
val = QMessageBox.information(self,
'The file has deleted from disc!',
- self.tr("%s\n" % editorWidget.ID),
+ (self.tr("%s\n") % editorWidget.ID),
QMessageBox.Yes)
self.question_already_open = False
@@ -272,7 +272,7 @@ def removeTab(self, index):
if widget.textModified and not self.follow_mode:
fileName = self.tabBar().tabText(self.currentIndex())
val = QMessageBox.question(
- self, self.tr('The file %s was not saved' %
+ self, (self.tr('The file %s was not saved') %
fileName),
self.tr("Do you want to save before closing?"),
QMessageBox.Yes | QMessageBox.No |
4 ninja_ide/gui/menus/menu_about.py
View
@@ -33,8 +33,8 @@ def __init__(self, menuAbout):
QObject.__init__(self)
startPageAction = menuAbout.addAction(self.tr("Show Start Page"))
- helpAction = menuAbout.addAction(self.tr("Python Help (%s)" %
- resources.get_shortcut("Help").toString(QKeySequence.NativeText)))
+ helpAction = menuAbout.addAction(self.tr("Python Help (%s)") %
+ resources.get_shortcut("Help").toString(QKeySequence.NativeText))
menuAbout.addSeparator()
reportBugAction = menuAbout.addAction(self.tr("Report Bugs!"))
pluginsDocAction = menuAbout.addAction(
20 ninja_ide/gui/menus/menu_edit.py
View
@@ -36,35 +36,35 @@ def __init__(self, menuEdit, toolbar):
QObject.__init__(self)
undoAction = menuEdit.addAction(QIcon(resources.IMAGES['undo']),
- self.trUtf8("Undo (%s+Z)" % settings.OS_KEY))
+ (self.trUtf8("Undo (%s+Z)") % settings.OS_KEY))
redoAction = menuEdit.addAction(QIcon(resources.IMAGES['redo']),
- self.trUtf8("Redo (%s)" % resources.get_shortcut("Redo").toString(
+ (self.trUtf8("Redo (%s)") % resources.get_shortcut("Redo").toString(
QKeySequence.NativeText)))
cutAction = menuEdit.addAction(QIcon(resources.IMAGES['cut']),
- self.trUtf8("&Cut (%s+X)" % settings.OS_KEY))
+ (self.trUtf8("&Cut (%s+X)") % settings.OS_KEY))
copyAction = menuEdit.addAction(QIcon(resources.IMAGES['copy']),
- self.trUtf8("&Copy (%s+C)" % settings.OS_KEY))
+ (self.trUtf8("&Copy (%s+C)") % settings.OS_KEY))
pasteAction = menuEdit.addAction(QIcon(resources.IMAGES['paste']),
- self.trUtf8("&Paste (%s+V)" % settings.OS_KEY))
+ (self.trUtf8("&Paste (%s+V)") % settings.OS_KEY))
menuEdit.addSeparator()
findAction = menuEdit.addAction(QIcon(resources.IMAGES['find']),
- self.trUtf8("Find (%s)" % resources.get_shortcut("Find").toString(
+ (self.trUtf8("Find (%s)") % resources.get_shortcut("Find").toString(
QKeySequence.NativeText)))
findReplaceAction = menuEdit.addAction(
QIcon(resources.IMAGES['findReplace']),
- self.trUtf8("Find/Replace (%s)" %
+ (self.trUtf8("Find/Replace (%s)") %
resources.get_shortcut("Find-replace").toString(
QKeySequence.NativeText)))
findWithWordAction = menuEdit.addAction(
- self.trUtf8("Find using word under cursor (%s)" %
+ (self.trUtf8("Find using word under cursor (%s)") %
resources.get_shortcut("Find-with-word").toString(
QKeySequence.NativeText)))
findInFilesAction = menuEdit.addAction(QIcon(resources.IMAGES['find']),
- self.trUtf8("Find in Files (%s)" %
+ (self.trUtf8("Find in Files (%s)") %
resources.get_shortcut("Find-in-files").toString(
QKeySequence.NativeText)))
locatorAction = menuEdit.addAction(QIcon(resources.IMAGES['locator']),
- self.trUtf8("Code Locator (%s)" %
+ (self.trUtf8("Code Locator (%s)") %
resources.get_shortcut("Code-locator").toString(
QKeySequence.NativeText)))
menuEdit.addSeparator()
18 ninja_ide/gui/menus/menu_file.py
View
@@ -39,17 +39,17 @@ def __init__(self, menuFile, toolbar, ide):
QObject.__init__(self)
newAction = menuFile.addAction(QIcon(resources.IMAGES['new']),
- self.trUtf8("&New File (%s)" %
+ (self.trUtf8("&New File (%s)") %
resources.get_shortcut("New-file").toString(
QKeySequence.NativeText)))
newProjectAction = menuFile.addAction(
QIcon(resources.IMAGES['newProj']),
- self.trUtf8("New Pro&ject (%s)" %
+ (self.trUtf8("New Pro&ject (%s)") %
resources.get_shortcut("New-project").toString(
QKeySequence.NativeText)))
menuFile.addSeparator()
saveAction = menuFile.addAction(QIcon(resources.IMAGES['save']),
- self.trUtf8("&Save (%s)" %
+ (self.trUtf8("&Save (%s)") %
resources.get_shortcut("Save-file").toString(
QKeySequence.NativeText)))
saveAsAction = menuFile.addAction(QIcon(resources.IMAGES['saveAs']),
@@ -58,23 +58,23 @@ def __init__(self, menuFile, toolbar, ide):
self.trUtf8("Save All"))
saveProjectAction = menuFile.addAction(QIcon(
resources.IMAGES['saveAll']),
- self.trUtf8("Save Pro&ject (%s)" %
+ (self.trUtf8("Save Pro&ject (%s)") %
resources.get_shortcut("Save-project").toString(
QKeySequence.NativeText)))
menuFile.addSeparator()
reloadFileAction = menuFile.addAction(
QIcon(resources.IMAGES['reload-file']),
- self.trUtf8("Reload File (%s)" %
+ (self.trUtf8("Reload File (%s)") %
resources.get_shortcut("Reload-file").toString(
QKeySequence.NativeText)))
menuFile.addSeparator()
openAction = menuFile.addAction(QIcon(resources.IMAGES['open']),
- self.trUtf8("&Open (%s)" %
+ (self.trUtf8("&Open (%s)") %
resources.get_shortcut("Open-file").toString(
QKeySequence.NativeText)))
openProjectAction = menuFile.addAction(
QIcon(resources.IMAGES['openProj']),
- self.trUtf8("Open &Project (%s)" %
+ (self.trUtf8("Open &Project (%s)") %
resources.get_shortcut("Open-project").toString(
QKeySequence.NativeText)))
self.recent_files = menuFile.addMenu(self.trUtf8('Open Recent Files'))
@@ -87,12 +87,12 @@ def __init__(self, menuFile, toolbar, ide):
self.trUtf8("Deactivate Profile"))
menuFile.addSeparator()
printFile = menuFile.addAction(QIcon(resources.IMAGES['print']),
- self.trUtf8("Pr&int File (%s)" %
+ (self.trUtf8("Pr&int File (%s)") %
resources.get_shortcut("Print-file").toString(
QKeySequence.NativeText)))
closeAction = menuFile.addAction(
ide.style().standardIcon(QStyle.SP_DialogCloseButton),
- self.trUtf8("&Close Tab (%s)" %
+ (self.trUtf8("&Close Tab (%s)") %
resources.get_shortcut("Close-tab").toString(
QKeySequence.NativeText)))
closeProjectsAction = menuFile.addAction(
6 ninja_ide/gui/menus/menu_project.py
View
@@ -31,7 +31,7 @@ def __init__(self, menuProject, toolbar):
QObject.__init__(self)
runAction = menuProject.addAction(QIcon(resources.IMAGES['play']),
- self.trUtf8("Run Project (%s)" %
+ (self.trUtf8("Run Project (%s)") %
resources.get_shortcut("Run-project").toString(
QKeySequence.NativeText)))
# debugAction = menuProject.addAction(
@@ -41,11 +41,11 @@ def __init__(self, menuProject, toolbar):
# QKeySequence.NativeText)))
runFileAction = menuProject.addAction(
QIcon(resources.IMAGES['file-run']),
- self.trUtf8("Run File (%s)" %
+ (self.trUtf8("Run File (%s)") %
resources.get_shortcut("Run-file").toString(
QKeySequence.NativeText)))
stopAction = menuProject.addAction(QIcon(resources.IMAGES['stop']),
- self.trUtf8("Stop (%s)" %
+ (self.trUtf8("Stop (%s)") %
resources.get_shortcut("Stop-execution").toString(
QKeySequence.NativeText)))
menuProject.addSeparator()
24 ninja_ide/gui/menus/menu_source.py
View
@@ -34,30 +34,30 @@ def __init__(self, menuSource):
indentMoreAction = menuSource.addAction(
QIcon(resources.IMAGES['indent-more']),
- self.trUtf8("Indent More (%s)" %
+ (self.trUtf8("Indent More (%s)") %
QKeySequence(Qt.Key_Tab).toString(QKeySequence.NativeText)))
indentLessAction = menuSource.addAction(
QIcon(resources.IMAGES['indent-less']),
- self.trUtf8("Indent Less (%s)" %
+ (self.trUtf8("Indent Less (%s)") %
resources.get_shortcut("Indent-less").toString(
QKeySequence.NativeText)))
menuSource.addSeparator()
commentAction = menuSource.addAction(
QIcon(resources.IMAGES['comment-code']),
- self.trUtf8("Comment (%s)" %
+ (self.trUtf8("Comment (%s)") %
resources.get_shortcut("Comment").toString(
QKeySequence.NativeText)))
unCommentAction = menuSource.addAction(
QIcon(resources.IMAGES['uncomment-code']),
- self.trUtf8("Uncomment (%s)" %
+ (self.trUtf8("Uncomment (%s)") %
resources.get_shortcut("Uncomment").toString(
QKeySequence.NativeText)))
horizontalLineAction = menuSource.addAction(
- self.trUtf8("Insert Horizontal Line (%s)" %
+ (self.trUtf8("Insert Horizontal Line (%s)") %
resources.get_shortcut("Horizontal-line").toString(
QKeySequence.NativeText)))
titleCommentAction = menuSource.addAction(
- self.trUtf8("Insert Title Comment (%s)" %
+ (self.trUtf8("Insert Title Comment (%s)") %
resources.get_shortcut("Title-comment").toString(
QKeySequence.NativeText)))
countCodeLinesAction = menuSource.addAction(
@@ -68,13 +68,13 @@ def __init__(self, menuSource):
# tellTaleAction.setEnabled(False)
goToDefinitionAction = menuSource.addAction(
QIcon(resources.IMAGES['go-to-definition']),
- self.trUtf8("Go To Definition (%s or %s+Click)" %
+ (self.trUtf8("Go To Definition (%s or %s+Click)") %
(resources.get_shortcut("Go-to-definition").toString(
QKeySequence.NativeText),
settings.OS_KEY)))
insertImport = menuSource.addAction(
QIcon(resources.IMAGES['insert-import']),
- self.trUtf8("Insert &Import (%s)" %
+ (self.trUtf8("Insert &Import (%s)") %
resources.get_shortcut("Import").toString(
QKeySequence.NativeText)))
menu_debugging = menuSource.addMenu(self.trUtf8("Debugging Tricks"))
@@ -93,18 +93,18 @@ def __init__(self, menuSource):
self.trUtf8("&Remove Trailing Spaces"))
replaceTabsSpaces = menuSource.addAction(
self.trUtf8("Replace Tabs With &Spaces"))
- moveUp = menuSource.addAction(self.trUtf8("Move &Up (%s)" %
+ moveUp = menuSource.addAction((self.trUtf8("Move &Up (%s)") %
resources.get_shortcut("Move-up").toString(
QKeySequence.NativeText)))
- moveDown = menuSource.addAction(self.trUtf8("Move &Down (%s)" %
+ moveDown = menuSource.addAction((self.trUtf8("Move &Down (%s)") %
resources.get_shortcut("Move-down").toString(
QKeySequence.NativeText)))
duplicate = menuSource.addAction(
- self.trUtf8("Duplica&te (%s)" %
+ (self.trUtf8("Duplica&te (%s)") %
resources.get_shortcut("Duplicate").toString(
QKeySequence.NativeText)))
remove = menuSource.addAction(
- self.trUtf8("&Remove Line (%s)" %
+ (self.trUtf8("&Remove Line (%s)") %
resources.get_shortcut("Remove-line").toString(
QKeySequence.NativeText)))
16 ninja_ide/gui/menus/menu_view.py
View
@@ -34,22 +34,22 @@ def __init__(self, menuView, toolbar, ide):
self.__ide = ide
self.hideConsoleAction = menuView.addAction(
- self.trUtf8("Show/Hide &Console (%s)" %
+ (self.trUtf8("Show/Hide &Console (%s)") %
resources.get_shortcut("Hide-misc").toString(
QKeySequence.NativeText)))
self.hideConsoleAction.setCheckable(True)
self.hideEditorAction = menuView.addAction(
- self.trUtf8("Show/Hide &Editor (%s)" %
+ (self.trUtf8("Show/Hide &Editor (%s)") %
resources.get_shortcut("Hide-editor").toString(
QKeySequence.NativeText)))
self.hideEditorAction.setCheckable(True)
self.hideAllAction = menuView.addAction(
- self.trUtf8("Show/Hide &All (%s)" %
+ (self.trUtf8("Show/Hide &All (%s)") %
resources.get_shortcut("Hide-all").toString(
QKeySequence.NativeText)))
self.hideAllAction.setCheckable(True)
self.hideExplorerAction = menuView.addAction(
- self.trUtf8("Show/Hide &Explorer (%s)" %
+ (self.trUtf8("Show/Hide &Explorer (%s)") %
resources.get_shortcut("Hide-explorer").toString(
QKeySequence.NativeText)))
self.hideExplorerAction.setCheckable(True)
@@ -58,23 +58,23 @@ def __init__(self, menuView, toolbar, ide):
self.hideToolbarAction.setCheckable(True)
self.fullscreenAction = menuView.addAction(
QIcon(resources.IMAGES['fullscreen']),
- self.trUtf8("Full Screen &Mode (%s)" %
+ (self.trUtf8("Full Screen &Mode (%s)") %
resources.get_shortcut("Full-screen").toString(
QKeySequence.NativeText)))
menuView.addSeparator()
splitTabHAction = menuView.addAction(
QIcon(resources.IMAGES['splitH']),
- self.trUtf8("Split Tabs Horizontally (%s)" %
+ (self.trUtf8("Split Tabs Horizontally (%s)") %
resources.get_shortcut("Split-horizontal").toString(
QKeySequence.NativeText)))
splitTabVAction = menuView.addAction(
QIcon(resources.IMAGES['splitV']),
- self.trUtf8("Split Tabs Vertically (%s)" %
+ (self.trUtf8("Split Tabs Vertically (%s)") %
resources.get_shortcut("Split-vertical").toString(
QKeySequence.NativeText)))
followModeAction = menuView.addAction(
QIcon(resources.IMAGES['follow']),
- self.trUtf8("Follow Mode (%s)" %
+ (self.trUtf8("Follow Mode (%s)") %
resources.get_shortcut("Follow-mode").toString(
QKeySequence.NativeText)))
groupTabsAction = menuView.addAction(
2  ninja_ide/gui/misc/run_widget.py
View
@@ -101,7 +101,7 @@ def process_error(self, error):
format_)
else:
self.output.textCursor().insertText(
- self.tr('Error during execution, QProcess error: %d' % error),
+ (self.tr('Error during execution, QProcess error: %d') % error),
format_)
def finish_execution(self, exitCode, exitStatus):
8 ninja_ide/gui/status_bar.py
View
@@ -260,14 +260,14 @@ def __init__(self, parent):
self._btnFind = QPushButton(QIcon(resources.IMAGES['find']), '')
self.btnPrevious = QPushButton(
self.style().standardIcon(QStyle.SP_ArrowLeft), '')
- self.btnPrevious.setToolTip(self.trUtf8("Press %s" %
+ self.btnPrevious.setToolTip(self.trUtf8("Press %s") %
resources.get_shortcut("Find-previous").toString(
- QKeySequence.NativeText)))
+ QKeySequence.NativeText))
self.btnNext = QPushButton(
self.style().standardIcon(QStyle.SP_ArrowRight), '')
- self.btnNext.setToolTip(self.trUtf8("Press %s" %
+ self.btnNext.setToolTip(self.trUtf8("Press %s") %
resources.get_shortcut("Find-next").toString(
- QKeySequence.NativeText)))
+ QKeySequence.NativeText))
hSearch.addWidget(self._btnClose)
hSearch.addWidget(self._line)
hSearch.addWidget(self._btnFind)
2  ninja_ide/gui/updates.py
View
@@ -59,7 +59,7 @@ def __init__(self, parent):
def setup_menu(self, show_downloads=False):
self.menu = QMenu()
if show_downloads:
- self.download = QAction(self.tr("Download Version: %s!" %
+ self.download = QAction((self.tr("Download Version: %s!") %
self.ide_version),
self, triggered=self._show_download)
self.menu.addAction(self.download)
10 ninja_ide/tools/ui_tools.py
View
@@ -106,10 +106,10 @@ def __init__(self):
def add_item_to_tree(self, folder, tree, item_type=None, parent=None):
if item_type is None:
item = QTreeWidgetItem()
- item.setText(0, self.tr(' LOADING: "%s"' % folder))
+ item.setText(0, (self.tr(' LOADING: "%s"') % folder))
else:
item = item_type(parent,
- self.tr(' LOADING: "%s"' % folder), folder)
+ (self.tr(' LOADING: "%s"') % folder), folder)
tree.addTopLevelItem(item)
tree.setItemWidget(item, 0, self)
return item
@@ -484,8 +484,8 @@ def save_profile(self):
if self.profileList.currentItem():
profileName = self.profileList.currentItem().text()
self.save_function(profileName)
- self.ide.show_status_message(self.tr("Profile %s Updated!" %
- profileName))
+ self.ide.show_status_message(self.tr("Profile %s Updated!") %
+ profileName)
self.load_profile_content()
def open_profile(self):
@@ -552,7 +552,7 @@ def __init__(self, lineEdit):
lineEdit.setTextMargins(0, 0, 60, 0)
def update_count(self, index, total, hasSearch=False):
- message = self.tr("%s of %s" % (index, total))
+ message = self.tr("%s of %s") % (index, total)
self.counter.setText(message)
self.counter.setStyleSheet("background: none;color: gray;")
if index == 0 and total == 0 and hasSearch:

No commit comments for this range

Something went wrong with that request. Please try again.