Skip to content

Commit

Permalink
Do not take category focus on add launcher
Browse files Browse the repository at this point in the history
  • Loading branch information
bluesabre committed Aug 2, 2023
1 parent 4c7de93 commit deb0261
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
3 changes: 3 additions & 0 deletions menulibre/ApplicationEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,5 +280,8 @@ def commit(self):
self._name_entry.commit()
self._comment_entry.commit()

def take_focus(self):
self._icon_entry.grab_focus()

def _on_changed(self, widget, key, value):
self.emit('value-changed', key, value)
2 changes: 2 additions & 0 deletions menulibre/CategoryEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,10 +589,12 @@ def _get_required_categories(self, parent_directory):
return [name]

def insert_required_categories(self, parent_directory):
self._row_change_inhibit = True
current_categories = self._get_categories()
for category in self._get_required_categories(parent_directory):
if category not in current_categories:
self._append(category)
self._row_change_inhibit = False

def _on_row_changed(self, model, path, treeiter):
if self._row_change_singleton:
Expand Down
4 changes: 4 additions & 0 deletions menulibre/MenulibreApplication.py
Original file line number Diff line number Diff line change
Expand Up @@ -1111,6 +1111,8 @@ def add_launcher(self):
self.actions['save_launcher'].set_sensitive(True)
self.save_button.set_sensitive(True)

self.editor.take_focus()

def add_directory(self):
"""Add Directory callback function."""
# Translators: Placeholder text for a newly created directory.
Expand All @@ -1132,6 +1134,8 @@ def add_directory(self):
self.actions['save_launcher'].set_sensitive(True)
self.save_button.set_sensitive(True)

self.editor.take_focus()

def add_separator(self):
"""Add Separator callback function."""
name = "<s> </s>"
Expand Down
20 changes: 10 additions & 10 deletions po/menulibre.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-01 07:00-0400\n"
"POT-Creation-Date: 2023-08-02 06:56-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -1020,7 +1020,7 @@ msgstr ""

#. Translators: Help action tooltip
#: ../menulibre/CommandEditor.py:90 ../menulibre/MenulibreApplication.py:489
#: ../menulibre/MenulibreApplication.py:1665
#: ../menulibre/MenulibreApplication.py:1669
msgid "Help"
msgstr ""

Expand Down Expand Up @@ -1292,7 +1292,7 @@ msgstr ""

#. Translators: Separator menu item
#: ../menulibre/MenuEditor.py:126 ../menulibre/MenulibreApplication.py:846
#: ../menulibre/MenulibreApplication.py:1139
#: ../menulibre/MenulibreApplication.py:1143
msgid "Separator"
msgstr ""

Expand Down Expand Up @@ -1456,7 +1456,7 @@ msgstr ""

#. Translators: Quit action tooltip
#: ../menulibre/MenulibreApplication.py:480
#: ../menulibre/MenulibreApplication.py:1667
#: ../menulibre/MenulibreApplication.py:1671
msgid "Quit"
msgstr ""

Expand All @@ -1472,7 +1472,7 @@ msgstr ""

#. Translators: About action tooltip
#: ../menulibre/MenulibreApplication.py:498
#: ../menulibre/MenulibreApplication.py:1666
#: ../menulibre/MenulibreApplication.py:1670
msgid "About"
msgstr ""

Expand Down Expand Up @@ -1535,30 +1535,30 @@ msgid "A small descriptive blurb about this application."
msgstr ""

#. Translators: Placeholder text for a newly created directory.
#: ../menulibre/MenulibreApplication.py:1117
#: ../menulibre/MenulibreApplication.py:1119
msgid "New Directory"
msgstr ""

#. Translators: Placeholder text for a newly created directory's
#. description.
#: ../menulibre/MenulibreApplication.py:1120
#: ../menulibre/MenulibreApplication.py:1122
msgid "A small descriptive blurb about this directory."
msgstr ""

#. Translators: Confirmation dialog to delete the selected
#. separator.
#: ../menulibre/MenulibreApplication.py:1541
#: ../menulibre/MenulibreApplication.py:1545
msgid "Are you sure you want to delete this separator?"
msgstr ""

#. Translators: Confirmation dialog to delete the selected launcher.
#: ../menulibre/MenulibreApplication.py:1545
#: ../menulibre/MenulibreApplication.py:1549
#, python-format
msgid "Are you sure you want to delete \"%s\"?"
msgstr ""

#. Translators: Menu item to open the Parsing Errors dialog.
#: ../menulibre/MenulibreApplication.py:1660
#: ../menulibre/MenulibreApplication.py:1664
msgid "Parsing Error Log"
msgstr ""

Expand Down

0 comments on commit deb0261

Please sign in to comment.