Dialog window changes, copy/paste changes, thread change

This commit is contained in:
itdominator 2022-03-17 01:39:03 -05:00
parent 22c9fa301b
commit 2278cdc0c3
4 changed files with 46 additions and 14 deletions

View File

@ -110,7 +110,9 @@ class ShowHideMixin:
def show_new_file_menu(self, widget=None, eve=None):
self.builder.get_object("context_menu_fname").set_text("")
context_menu_fname = self.builder.get_object("context_menu_fname")
context_menu_fname.set_text("")
context_menu_fname.grab_focus()
new_file_menu = self.builder.get_object("new_file_menu")
response = new_file_menu.run()

View File

@ -42,7 +42,14 @@ class GridMixin:
def update_store(self, i, store, icon, tab, dir, file):
fpath = f"{dir}/{file}"
loop = True
while loop:
try:
itr = store.get_iter(i)
loop = False
except:
pass
if not icon:
icon = self.get_system_thumbnail(fpath, tab.SYS_ICON_WH[0])

View File

@ -115,7 +115,7 @@ class WidgetFileActionMixin:
entry.set_position(-1)
def do_file_search(self, widget, eve=None):
query = widget.get_text()
query = widget.get_text().lower()
self.search_icon_grid.unselect_all()
for i, file in enumerate(self.search_tab.get_files()):
if query and query in file[0].lower():
@ -123,8 +123,8 @@ class WidgetFileActionMixin:
self.search_icon_grid.select_path(path)
items = self.search_icon_grid.get_selected_items()
if len(items) == 1:
self.search_icon_grid.scroll_to_path(items[0], True, 0.5, 0.5)
if len(items) > 0:
self.search_icon_grid.scroll_to_path(items[-1], True, 0.5, 0.5)
def open_files(self):
@ -290,6 +290,9 @@ class WidgetFileActionMixin:
file = Gio.File.new_for_path(path)
if _target_path:
if file.get_parent().get_path() == _target_path:
raise Exception("Parent dir of target and file locations are the same! Won't copy or move!")
if os.path.isdir(_target_path):
info = file.query_info("standard::display-name", 0, cancellable=None)
_target = f"{_target_path}/{info.get_display_name()}"

View File

@ -623,20 +623,24 @@ SolarFM is developed on Atom, git, and using Python 3+ with Gtk GObject introspe
</object>
<object class="GtkDialog" id="new_file_menu">
<property name="can-focus">False</property>
<property name="type">popup</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<property name="window-position">center</property>
<property name="window-position">center-always</property>
<property name="destroy-with-parent">True</property>
<property name="type-hint">splashscreen</property>
<property name="type-hint">normal</property>
<property name="skip-taskbar-hint">True</property>
<property name="skip-pager-hint">True</property>
<property name="decorated">False</property>
<property name="deletable">False</property>
<property name="gravity">center</property>
<signal name="focus-out-event" handler="hide_new_file_menu" swapped="no"/>
<child internal-child="vbox">
<object class="GtkBox">
<property name="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-top">5</property>
<property name="margin-bottom">5</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
@ -694,7 +698,13 @@ SolarFM is developed on Atom, git, and using Python 3+ with Gtk GObject introspe
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="has-focus">True</property>
<property name="tooltip-text" translatable="yes">New File/Dir Name...</property>
<property name="activates-default">True</property>
<property name="primary-icon-stock">gtk-edit</property>
<property name="primary-icon-activatable">False</property>
<property name="secondary-icon-activatable">False</property>
<property name="primary-icon-sensitive">False</property>
<property name="secondary-icon-sensitive">False</property>
<property name="placeholder-text" translatable="yes">New File/Dir Name...</property>
</object>
<packing>
@ -795,15 +805,15 @@ SolarFM is developed on Atom, git, and using Python 3+ with Gtk GObject introspe
<object class="GtkDialog" id="file_exists_dialog">
<property name="height-request">120</property>
<property name="can-focus">False</property>
<property name="type">popup</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<property name="window-position">center</property>
<property name="window-position">center-always</property>
<property name="destroy-with-parent">True</property>
<property name="type-hint">splashscreen</property>
<property name="type-hint">normal</property>
<property name="skip-taskbar-hint">True</property>
<property name="skip-pager-hint">True</property>
<property name="urgency-hint">True</property>
<property name="decorated">False</property>
<property name="deletable">False</property>
<property name="gravity">center</property>
<child internal-child="vbox">
@ -1233,19 +1243,23 @@ SolarFM is developed on Atom, git, and using Python 3+ with Gtk GObject introspe
</object>
<object class="GtkDialog" id="edit_file_menu">
<property name="can-focus">False</property>
<property name="type">popup</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<property name="window-position">center</property>
<property name="window-position">center-always</property>
<property name="destroy-with-parent">True</property>
<property name="type-hint">splashscreen</property>
<property name="type-hint">normal</property>
<property name="skip-taskbar-hint">True</property>
<property name="skip-pager-hint">True</property>
<property name="decorated">False</property>
<property name="deletable">False</property>
<property name="gravity">center</property>
<child internal-child="vbox">
<object class="GtkBox">
<property name="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-top">5</property>
<property name="margin-bottom">5</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
@ -1336,7 +1350,13 @@ SolarFM is developed on Atom, git, and using Python 3+ with Gtk GObject introspe
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="has-focus">True</property>
<property name="tooltip-text" translatable="yes">Rename To:</property>
<property name="activates-default">True</property>
<property name="primary-icon-stock">gtk-edit</property>
<property name="primary-icon-activatable">False</property>
<property name="secondary-icon-activatable">False</property>
<property name="primary-icon-sensitive">False</property>
<property name="secondary-icon-sensitive">False</property>
<property name="placeholder-text" translatable="yes">To:</property>
<signal name="key-release-event" handler="hide_edit_file_menu_enter_key" swapped="no"/>
</object>