fixed new file ui

This commit is contained in:
itdominator 2022-01-29 19:32:56 -06:00
parent 63c41d5e2a
commit 3d719ad6f6
3 changed files with 13 additions and 8 deletions

View File

@ -157,9 +157,7 @@ class Controller(WidgetFileActionMixin, PaneMixin, WindowMixin, ShowHideMixin, \
if action == "empty_trash":
self.empty_trash()
if action == "create":
self.create_files()
self.hide_new_file_menu()
self.ctrlDown = False

View File

@ -16,7 +16,6 @@ class ShowHideMixin:
def stop_file_searching(self, widget=None, eve=None):
self.is_searching = False
def show_exists_page(self, widget=None, eve=None):
response = self.file_exists_dialog.run()
self.file_exists_dialog.hide()
@ -81,12 +80,14 @@ class ShowHideMixin:
appchooser_widget = self.builder.get_object("appchooser_widget")
response = appchooser_menu.run()
if response == Gtk.ResponseType.CANCEL:
self.hide_appchooser_menu()
if response == Gtk.ResponseType.OK:
self.open_with_files(appchooser_widget)
self.hide_appchooser_menu()
if response == Gtk.ResponseType.CANCEL:
self.hide_appchooser_menu()
def hide_appchooser_menu(self, widget=None, eve=None):
self.builder.get_object("appchooser_menu").hide()
@ -103,12 +104,18 @@ class ShowHideMixin:
def show_new_file_menu(self, widget=None, eve=None):
self.builder.get_object("new_file_menu").run()
self.builder.get_object("context_menu_fname").set_text("")
new_file_menu = self.builder.get_object("new_file_menu")
response = new_file_menu.run()
if response == Gtk.ResponseType.APPLY:
self.create_files()
if response == Gtk.ResponseType.CANCEL:
self.hide_new_file_menu()
def hide_new_file_menu(self, widget=None, eve=None):
self.builder.get_object("new_file_menu").hide()
def show_edit_file_menu(self, widget=None, eve=None):
if widget:
widget.grab_focus()

View File

@ -239,7 +239,7 @@ class WidgetFileActionMixin:
else: # Create Folder
self.handle_files([path], "create_dir")
fname_field.set_text("")
self.hide_new_file_menu()
def move_files(self, files, target):
self.handle_files(files, "move", target)