refactor and debug option added

This commit is contained in:
itdominator 2021-12-27 00:33:30 -06:00
parent af4eac4c17
commit a022fa29ea
2 changed files with 11 additions and 9 deletions

View File

@ -20,6 +20,9 @@ from __init__ import Main
if __name__ == "__main__": if __name__ == "__main__":
try: try:
# import web_pdb
# web_pdb.set_trace()
setproctitle('solarfm') setproctitle('solarfm')
faulthandler.enable() # For better debug info faulthandler.enable() # For better debug info
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()

View File

@ -196,9 +196,11 @@ class WindowMixin(TabMixin):
wid, tid = action.split("|") wid, tid = action.split("|")
store = iconview.get_model() store = iconview.get_model()
treePaths = iconview.get_selected_items() treePaths = iconview.get_selected_items()
uris = self.format_to_uris(store, wid, tid, treePaths) uris = self.format_to_uris(store, wid, tid, treePaths, True)
uris_text = '\n'.join(uris)
data.set_uris(uris) data.set_uris(uris)
data.set_text(uris_text, -1)
def grid_on_drag_motion(self, iconview, drag_context, x, y, data): def grid_on_drag_motion(self, iconview, drag_context, x, y, data):
wid, tid = iconview.get_name().split("|") wid, tid = iconview.get_name().split("|")
@ -211,16 +213,13 @@ class WindowMixin(TabMixin):
store, tab_label = self.get_store_and_label_from_notebook(notebook, f"{wid}|{tid}") store, tab_label = self.get_store_and_label_from_notebook(notebook, f"{wid}|{tid}")
view = self.get_fm_window(wid).get_view_by_id(tid) view = self.get_fm_window(wid).get_view_by_id(tid)
_uris = data.get_uris() uris = data.get_uris()
dest = f"{view.get_current_directory()}" dest = f"{view.get_current_directory()}"
if len(uris) > 0:
if len(_uris) > 0: self.move_files(uris, dest)
uris = [] else:
for uri in _uris: uris = data.get_text().split("\n")
uris.append(uri.split("file://")[1])
self.move_files(uris, dest) self.move_files(uris, dest)
def create_new_view_notebook(self, widget=None, wid=None, path=None): def create_new_view_notebook(self, widget=None, wid=None, path=None):
self.create_tab(wid, path) self.create_tab(wid, path)