Skip to content

Commit

Permalink
Set menu roles manually where possible
Browse files Browse the repository at this point in the history
Qt tries to determine the role of a menu item based on its text. If the
text is "Preferences" it guesses that that menu item opens the
preferences dialog. On MacOS X this means the menu item is moved from
the View menu to the application menu. However, for translations this
doesn't seem to work, so this commit sets the menu roles manually. At
least that's the idea - no idea if it works.

See issue sqlitebrowser#200.
  • Loading branch information
MKleusberg committed Feb 11, 2015
1 parent 027ba81 commit 848b16f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/MainWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>311</width>
<height>531</height>
<width>294</width>
<height>444</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
Expand Down Expand Up @@ -796,7 +796,7 @@
<x>0</x>
<y>0</y>
<width>1000</width>
<height>25</height>
<height>19</height>
</rect>
</property>
<widget class="QMenu" name="fileMenu">
Expand Down Expand Up @@ -1252,6 +1252,9 @@
<property name="shortcut">
<string>Ctrl+Q</string>
</property>
<property name="menuRole">
<enum>QAction::QuitRole</enum>
</property>
</action>
<action name="fileImportSQLAction">
<property name="text">
Expand Down Expand Up @@ -1374,6 +1377,9 @@
<property name="whatsThis">
<string>Open the preferences window.</string>
</property>
<property name="menuRole">
<enum>QAction::PreferencesRole</enum>
</property>
</action>
<action name="viewDBToolbarAction">
<property name="checkable">
Expand Down Expand Up @@ -1402,6 +1408,9 @@
<property name="text">
<string>&amp;About...</string>
</property>
<property name="menuRole">
<enum>QAction::AboutRole</enum>
</property>
</action>
<action name="actionRecent_y_opened">
<property name="text">
Expand Down

0 comments on commit 848b16f

Please sign in to comment.