Skip to content

Use GApplication to parse command line options #1380

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace Tuba {
// public CssProvider zoom_css_provider = new CssProvider (); //FIXME: Zoom not working

public const GLib.OptionEntry[] APP_OPTIONS = {
{ "hidden", 0, 0, OptionArg.NONE, ref start_hidden, "Do not show main window on start", null },
{ "hidden", 0, 0, OptionArg.NONE, ref start_hidden, N_("Do not show main window on start"), null },
{ null }
};

Expand Down Expand Up @@ -182,18 +182,11 @@ namespace Tuba {
application_id = Build.DOMAIN;
flags = ApplicationFlags.HANDLES_OPEN;

add_main_option_entries (APP_OPTIONS);
app_locales = new Tuba.Locales ();
}

public static int main (string[] args) {
try {
var opt_context = new OptionContext ("- Options");
opt_context.add_main_entries (APP_OPTIONS, null);
opt_context.parse (ref args);
} catch (GLib.OptionError e) {
warning (e.message);
}

#if GSTREAMER
Gst.init (ref args);
#endif
Expand Down
Loading