/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
void nsApplicationChooser::Done(GtkWidget* chooser, gint response) {
nsCOMPtr<nsIGIOHandlerApp> gioHandler; switch (response) { case GTK_RESPONSE_OK: case GTK_RESPONSE_ACCEPT: {
RefPtr<GAppInfo> app_info =
gtk_app_chooser_get_app_info(GTK_APP_CHOOSER(chooser));
nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); if (app_info) {
giovfs->CreateHandlerAppFromAppId(g_app_info_get_id(app_info),
getter_AddRefs(gioHandler));
} else {
NS_WARNING( "Application chooser dialog accepted but no appinfo received.");
} break;
} case GTK_RESPONSE_CANCEL: case GTK_RESPONSE_CLOSE: case GTK_RESPONSE_DELETE_EVENT: break; default:
NS_WARNING("Unexpected response"); break;
}
// A "response" signal won't be sent again but "destroy" will be.
g_signal_handlers_disconnect_by_func(chooser, FuncToGpointer(OnDestroy), this);
gtk_widget_destroy(chooser);
if (mCallback) {
mCallback->Done(gioHandler);
mCallback = nullptr;
}
NS_RELEASE_THIS();
}
¤ Dauer der Verarbeitung: 0.16 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.