Skip to content

Commit

Permalink
Add exit action and new menu for recent files
Browse files Browse the repository at this point in the history
  • Loading branch information
jopohl committed Jan 21, 2024
1 parent 8a34513 commit d041bbc
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 153 deletions.
24 changes: 23 additions & 1 deletion data/ui/main.ui
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ image: url(:/icons/icons/splitter_handle_vertical.svg);
<x>0</x>
<y>0</y>
<width>798</width>
<height>27</height>
<height>30</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
Expand All @@ -358,13 +358,19 @@ image: url(:/icons/icons/splitter_handle_vertical.svg);
</property>
<addaction name="actionSamples_from_csv"/>
</widget>
<widget class="QMenu" name="menuRecent">
<property name="title">
<string>Recent</string>
</property>
</widget>
<addaction name="actionNew_Project"/>
<addaction name="actionProject_settings"/>
<addaction name="actionSave_project"/>
<addaction name="actionClose_project"/>
<addaction name="separator"/>
<addaction name="actionOpen"/>
<addaction name="actionOpen_directory"/>
<addaction name="menuRecent"/>
<addaction name="menuImport"/>
<addaction name="separator"/>
<addaction name="actionSpectrum_Analyzer"/>
Expand All @@ -375,6 +381,8 @@ image: url(:/icons/icons/splitter_handle_vertical.svg);
<addaction name="actionCloseAllFiles"/>
<addaction name="separator"/>
<addaction name="actionConvert_Folder_to_Project"/>
<addaction name="separator"/>
<addaction name="actionExit_URH"/>
</widget>
<widget class="QMenu" name="menuEdit">
<property name="title">
Expand Down Expand Up @@ -822,6 +830,20 @@ image: url(:/icons/icons/splitter_handle_vertical.svg);
<string>100% (disables demodulation)</string>
</property>
</action>
<action name="actionExit_URH">
<property name="icon">
<iconset theme="application-exit">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>Exit URH</string>
</property>
</action>
<action name="actionPlaceholder">
<property name="text">
<string>Placeholder</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
Expand Down
4 changes: 2 additions & 2 deletions src/urh/controller/MainController.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ def create_connects(self):
)
self.ui.actionSave_project.triggered.connect(self.save_project)
self.ui.actionClose_project.triggered.connect(self.close_project)
self.ui.actionExit_URH.triggered.connect(self.close)

self.ui.actionAbout_AutomaticHacker.triggered.connect(
self.on_show_about_clicked
Expand Down Expand Up @@ -352,13 +353,12 @@ def create_connects(self):
self.on_label_non_project_mode_link_activated
)

self.ui.menuFile.addSeparator()
for i in range(settings.MAX_RECENT_FILE_NR):
recent_file_action = QAction(self)
recent_file_action.setVisible(False)
recent_file_action.triggered.connect(self.on_open_recent_action_triggered)
self.recentFileActionList.append(recent_file_action)
self.ui.menuFile.addAction(self.recentFileActionList[i])
self.ui.menuRecent.addAction(self.recentFileActionList[i])

def add_plain_bits_from_txt(self, filename: str):
with open(filename) as f:
Expand Down
Loading

0 comments on commit d041bbc

Please sign in to comment.