Fix opening files with Open With...

This commit is contained in:
ARAKHNID 2024-04-12 16:24:43 -05:00
parent 977dc6f29e
commit ad144f6e0c
2 changed files with 4 additions and 4 deletions

View File

@ -3,6 +3,7 @@
<template class="CurtailWindow" parent="AdwApplicationWindow">
<property name="title" translatable="yes">Curtail</property>
<property name="default-width">650</property>
<property name="default-height">500</property>
<property name="content">
<object class="AdwToolbarView">

View File

@ -35,18 +35,17 @@ class Application(Adw.Application):
def do_startup(self):
Adw.Application.do_startup(self)
self.connect('open', self.file_open_handler)
def do_activate(self):
self.win = CurtailWindow(application=self)
self.win.present()
def file_open_handler(self, app, g_file_list, amount, ukwn):
def do_open(self, g_file_list, amount, ukwn):
self.do_activate()
filenames = []
for g_file in g_file_list:
filenames.append(g_file.get_uri())
self.win.handle_filenames(filenames)
final_filenames = self.win.handle_filenames(filenames)
self.win.compress_filenames(final_filenames)
def main(version):