-
-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework Application Class #702
Conversation
* move the ENTRIES constant to top * creation method before construct * instance - static, protected - public - private, ordering code style was updated and some methods simplified.
Gtk.Application has API to list and get windows registered with the application. use that instead of keeping track of windows by ourselves
local_command_line() and handle_local_options() are responsible for the command line parsing and adjusting the options for usage in command_line() that handles the actual program logic in the primary instance. this simplifies the primary instance work, and keep command line specific behavior to be parsed only from command line invocation.
tries to guarantee the behavior of the command line interface, both local and primary
@Marukesu I do not pretend to understand every aspect of this PR but it looks good and the test framework is impressive. However, when I install and run it from a different terminal app (I've tried XTerm and Blackbox) using no parameters, I get an immediate crash. The backtrace is :
|
Putting a null check in |
Other observations so far when launching from
|
|
As far as tested so far the |
@jeremypw the last commits should fix opening the terminal without arguments and the -v argument not returning. i would like to add test cases for them too, but i couldn't find a way to do that right now.
about #498, it's out of scope for this PR. The issue is that the restoration code will create a tab in the home directory if no tab is to be restored. I'm working in cleanup this code and fix it in another branch.
the new code ignores |
That's fine, I wasn't expecting it to be fixed in this PR.
I agree that creating a new tab is not necessary. Either a printed warning or a notification depending on means of calling would be good. |
While |
There is a slight difference between master and PR regarding the |
Modernize the Application class to better reflect the GLib.Application API, it now have a distinction between local and primary, command line and DBus invocations.
The command line logic was split and simplified:
--working-directory
is a command line only option, with DBus invocations expecting thecwd
option in theplatform-data
to be used instead.--commandline
works without=
, matching the behaviour of others long options.ApplicationFlags.CAN_OVERRIDE_APP_ID
was added to facilitate testing changes without needing to close a already open instance of terminal.Test are added, to assure that we don't cause any regression in the command line/options parsing when modifying the class in the future.