Commit abb9da94 authored by Alberts Muktupāvels's avatar Alberts Muktupāvels
Browse files

end-session-dialog: rename FlashbackInhibitDialog to GfInhibitDialog

parent 0eac1ad1
......@@ -36,9 +36,9 @@ struct _GfEndSessionDialog
G_DEFINE_TYPE (GfEndSessionDialog, gf_end_session_dialog, G_TYPE_OBJECT)
static void
inhibit_dialog_response (FlashbackInhibitDialog *dialog,
guint response_id,
gpointer user_data)
inhibit_dialog_response (GfInhibitDialog *dialog,
guint response_id,
gpointer user_data)
{
DBusEndSessionDialog *object;
gint action;
......@@ -48,21 +48,21 @@ inhibit_dialog_response (FlashbackInhibitDialog *dialog,
switch (response_id)
{
case FLASHBACK_RESPONSE_CANCEL:
case GF_RESPONSE_CANCEL:
break;
case FLASHBACK_RESPONSE_ACCEPT:
if (action == FLASHBACK_LOGOUT_ACTION_LOGOUT)
case GF_RESPONSE_ACCEPT:
if (action == GF_LOGOUT_ACTION_LOGOUT)
dbus_end_session_dialog_emit_confirmed_logout (object);
else if (action == FLASHBACK_LOGOUT_ACTION_SHUTDOWN)
else if (action == GF_LOGOUT_ACTION_SHUTDOWN)
dbus_end_session_dialog_emit_confirmed_shutdown (object);
else if (action == FLASHBACK_LOGOUT_ACTION_REBOOT)
else if (action == GF_LOGOUT_ACTION_REBOOT)
dbus_end_session_dialog_emit_confirmed_reboot (object);
else if (action == FLASHBACK_LOGOUT_ACTION_HIBERNATE)
else if (action == GF_LOGOUT_ACTION_HIBERNATE)
dbus_end_session_dialog_emit_confirmed_hibernate (object);
else if (action == FLASHBACK_LOGOUT_ACTION_SUSPEND)
else if (action == GF_LOGOUT_ACTION_SUSPEND)
dbus_end_session_dialog_emit_confirmed_suspend (object);
else if (action == FLASHBACK_LOGOUT_ACTION_HYBRID_SLEEP)
else if (action == GF_LOGOUT_ACTION_HYBRID_SLEEP)
dbus_end_session_dialog_emit_confirmed_hybrid_sleep (object);
else
g_assert_not_reached ();
......@@ -73,12 +73,12 @@ inhibit_dialog_response (FlashbackInhibitDialog *dialog,
break;
}
flashback_inhibit_dialog_close (dialog);
gf_inhibit_dialog_close (dialog);
}
static void
inhibit_dialog_close (FlashbackInhibitDialog *dialog,
gpointer user_data)
inhibit_dialog_close (GfInhibitDialog *dialog,
gpointer user_data)
{
DBusEndSessionDialog *object;
......@@ -109,29 +109,28 @@ handle_open (DBusEndSessionDialog *object,
gpointer user_data)
{
GfEndSessionDialog *dialog;
FlashbackInhibitDialog *inhibit_dialog;
GfInhibitDialog *inhibit_dialog;
dialog = GF_END_SESSION_DIALOG (user_data);
if (dialog->dialog != NULL)
{
inhibit_dialog = FLASHBACK_INHIBIT_DIALOG (dialog->dialog);
inhibit_dialog = GF_INHIBIT_DIALOG (dialog->dialog);
g_object_set (dialog->dialog,
"inhibitor-paths", inhibitor_object_paths,
NULL);
flashback_inhibit_dialog_present (inhibit_dialog, timestamp);
gf_inhibit_dialog_present (inhibit_dialog, timestamp);
dbus_end_session_dialog_complete_open (object, invocation);
return TRUE;
}
dialog->dialog = flashback_inhibit_dialog_new (type, seconds_to_stay_open,
inhibitor_object_paths);
dialog->dialog = gf_inhibit_dialog_new (type, seconds_to_stay_open,
inhibitor_object_paths);
inhibit_dialog = FLASHBACK_INHIBIT_DIALOG (dialog->dialog);
inhibit_dialog = GF_INHIBIT_DIALOG (dialog->dialog);
g_signal_connect (dialog->dialog, "response",
G_CALLBACK (inhibit_dialog_response), object);
......@@ -143,7 +142,7 @@ handle_open (DBusEndSessionDialog *object,
g_signal_connect (object, "closed",
G_CALLBACK (closed), dialog);
flashback_inhibit_dialog_present (inhibit_dialog, timestamp);
gf_inhibit_dialog_present (inhibit_dialog, timestamp);
dbus_end_session_dialog_complete_open (object, invocation);
return TRUE;
......
/*
* Copyright (C) 2008 William Jon McCann <mccann@jhu.edu>
* Copyright (C) 2015 Alberts Muktupāvels
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -15,62 +16,53 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FLASHBACK_INHIBIT_DIALOG_H
#define FLASHBACK_INHIBIT_DIALOG_H
#ifndef GF_INHIBIT_DIALOG_H
#define GF_INHIBIT_DIALOG_H
#include <glib-object.h>
#include <gtk/gtk.h>
G_BEGIN_DECLS
typedef enum {
FLASHBACK_LOGOUT_ACTION_LOGOUT,
FLASHBACK_LOGOUT_ACTION_SHUTDOWN,
FLASHBACK_LOGOUT_ACTION_REBOOT,
FLASHBACK_LOGOUT_ACTION_HIBERNATE,
FLASHBACK_LOGOUT_ACTION_SUSPEND,
FLASHBACK_LOGOUT_ACTION_HYBRID_SLEEP
} FlashbackLogoutAction;
typedef enum
{
GF_LOGOUT_ACTION_LOGOUT,
GF_LOGOUT_ACTION_SHUTDOWN,
GF_LOGOUT_ACTION_REBOOT,
GF_LOGOUT_ACTION_HIBERNATE,
GF_LOGOUT_ACTION_SUSPEND,
GF_LOGOUT_ACTION_HYBRID_SLEEP
} GfLogoutAction;
typedef enum {
FLASHBACK_RESPONSE_CANCEL,
FLASHBACK_RESPONSE_ACCEPT
} FlashbackResponseType;
typedef enum
{
GF_RESPONSE_CANCEL,
GF_RESPONSE_ACCEPT
} GfResponseType;
#define FLASHBACK_TYPE_INHIBIT_DIALOG (flashback_inhibit_dialog_get_type ())
#define FLASHBACK_INHIBIT_DIALOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), FLASHBACK_TYPE_INHIBIT_DIALOG, FlashbackInhibitDialog))
#define FLASHBACK_INHIBIT_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), FLASHBACK_TYPE_INHIBIT_DIALOG, FlashbackInhibitDialogClass))
#define FLASHBACK_IS_INHIBIT_DIALOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), FLASHBACK_TYPE_INHIBIT_DIALOG))
#define FLASHBACK_IS_INHIBIT_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), FLASHBACK_TYPE_INHIBIT_DIALOG))
#define FLASHBACK_INHIBIT_DIALOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), FLASHBACK_TYPE_INHIBIT_DIALOG, FlashbackInhibitDialogClass))
#define GF_TYPE_INHIBIT_DIALOG gf_inhibit_dialog_get_type ()
G_DECLARE_DERIVABLE_TYPE (GfInhibitDialog, gf_inhibit_dialog,
GF, INHIBIT_DIALOG, GtkWindow)
typedef struct _FlashbackInhibitDialog FlashbackInhibitDialog;
typedef struct _FlashbackInhibitDialogClass FlashbackInhibitDialogClass;
typedef struct _FlashbackInhibitDialogPrivate FlashbackInhibitDialogPrivate;
struct _GfInhibitDialogClass
{
GtkWindowClass parent_class;
struct _FlashbackInhibitDialog {
GtkWindow parent;
FlashbackInhibitDialogPrivate *priv;
void (* response) (GfInhibitDialog *dialog,
gint response_id);
void (* close) (GfInhibitDialog *dialog);
};
struct _FlashbackInhibitDialogClass {
GtkWindowClass parent_class;
GtkWidget *gf_inhibit_dialog_new (gint action,
gint seconds,
const gchar *const *inhibitor_paths);
void (* response) (FlashbackInhibitDialog *dialog, gint response_id);
void (* close) (FlashbackInhibitDialog *dialog);
};
GType flashback_inhibit_dialog_get_type (void);
GtkWidget *flashback_inhibit_dialog_new (gint action,
gint seconds,
const gchar *const *inhibitor_paths);
void gf_inhibit_dialog_response (GfInhibitDialog *dialog,
gint response_id);
void flashback_inhibit_dialog_response (FlashbackInhibitDialog *dialog,
gint response_id);
void flashback_inhibit_dialog_close (FlashbackInhibitDialog *dialog);
void gf_inhibit_dialog_close (GfInhibitDialog *dialog);
void flashback_inhibit_dialog_present (FlashbackInhibitDialog *dialog,
guint32 timestamp);
void gf_inhibit_dialog_present (GfInhibitDialog *dialog,
guint32 timestamp);
G_END_DECLS
......
......@@ -2,7 +2,7 @@
<!-- Generated with glade 3.18.3 -->
<interface domain="gnome-flashback">
<requires lib="gtk+" version="3.10"/>
<template class="FlashbackInhibitDialog" parent="GtkWindow">
<template class="GfInhibitDialog" parent="GtkWindow">
<property name="can_focus">False</property>
<property name="border_width">12</property>
<property name="resizable">False</property>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment