Skip to content

Commit

Permalink
Merge pull request #215 from ARAKHN1D/fix-open-with
Browse files Browse the repository at this point in the history
Fix opening files with Open With...
  • Loading branch information
Huluti committed Apr 21, 2024
2 parents 88d8f06 + ad144f6 commit f42dd64
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions data/ui/window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
7 changes: 3 additions & 4 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,17 @@ def __init__(self, *args, **kwargs):
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):
Expand Down

0 comments on commit f42dd64

Please sign in to comment.