[gedit] Implement file chooser hiding
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Implement file chooser hiding
- Date: Sat, 6 Sep 2014 09:09:07 +0000 (UTC)
commit 6c438cf81be77f91b0abd3dfe7d9ae974468ce30
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Sat Sep 6 11:05:46 2014 +0200
Implement file chooser hiding
gedit/gedit-file-chooser-dialog-gtk.c | 7 +++++++
gedit/gedit-file-chooser-dialog-osx.c | 14 ++++++++++++++
gedit/gedit-file-chooser-dialog.c | 13 +++++++++++++
gedit/gedit-file-chooser-dialog.h | 2 ++
4 files changed, 36 insertions(+), 0 deletions(-)
---
diff --git a/gedit/gedit-file-chooser-dialog-gtk.c b/gedit/gedit-file-chooser-dialog-gtk.c
index 9f9cdfc..812ac46 100644
--- a/gedit/gedit-file-chooser-dialog-gtk.c
+++ b/gedit/gedit-file-chooser-dialog-gtk.c
@@ -205,6 +205,12 @@ chooser_show (GeditFileChooserDialog *dialog)
}
static void
+chooser_hide (GeditFileChooserDialog *dialog)
+{
+ gtk_widget_hide (GTK_WIDGET (dialog));
+}
+
+static void
chooser_destroy (GeditFileChooserDialog *dialog)
{
gtk_widget_destroy (GTK_WIDGET (dialog));
@@ -262,6 +268,7 @@ gedit_file_chooser_dialog_gtk_chooser_init (gpointer g_iface,
iface->get_files = chooser_get_files;
iface->set_do_overwrite_confirmation = chooser_set_do_overwrite_confirmation;
iface->show = chooser_show;
+ iface->hide = chooser_hide;
iface->destroy = chooser_destroy;
iface->set_modal = chooser_set_modal;
iface->get_window = chooser_get_window;
diff --git a/gedit/gedit-file-chooser-dialog-osx.c b/gedit/gedit-file-chooser-dialog-osx.c
index 94f5bee..65f932f 100644
--- a/gedit/gedit-file-chooser-dialog-osx.c
+++ b/gedit/gedit-file-chooser-dialog-osx.c
@@ -752,6 +752,19 @@ chooser_show (GeditFileChooserDialog *dialog)
}
static void
+chooser_hide (GeditFileChooserDialog *dialog)
+{
+ GeditFileChooserDialogOSXPrivate *priv = GEDIT_FILE_CHOOSER_DIALOG_OSX (dialog)->priv;
+
+ if (!priv->is_running || priv->panel == NULL)
+ {
+ return;
+ }
+
+ [priv->panel orderOut:nil];
+}
+
+static void
chooser_destroy (GeditFileChooserDialog *dialog)
{
g_object_unref (dialog);
@@ -785,6 +798,7 @@ gedit_file_chooser_dialog_osx_chooser_init (gpointer g_iface,
iface->get_files = chooser_get_files;
iface->set_do_overwrite_confirmation = chooser_set_do_overwrite_confirmation;
iface->show = chooser_show;
+ iface->hide = chooser_hide;
iface->destroy = chooser_destroy;
iface->set_modal = chooser_set_modal;
}
diff --git a/gedit/gedit-file-chooser-dialog.c b/gedit/gedit-file-chooser-dialog.c
index 29dae56..07d322d 100644
--- a/gedit/gedit-file-chooser-dialog.c
+++ b/gedit/gedit-file-chooser-dialog.c
@@ -262,6 +262,19 @@ gedit_file_chooser_dialog_show (GeditFileChooserDialog *dialog)
}
void
+gedit_file_chooser_dialog_hide (GeditFileChooserDialog *dialog)
+{
+ GeditFileChooserDialogInterface *iface;
+
+ g_return_if_fail (GEDIT_IS_FILE_CHOOSER_DIALOG (dialog));
+
+ iface = GEDIT_FILE_CHOOSER_DIALOG_GET_IFACE (dialog);
+ g_return_if_fail (iface->hide != NULL);
+
+ iface->hide (dialog);
+}
+
+void
gedit_file_chooser_dialog_destroy (GeditFileChooserDialog *dialog)
{
GeditFileChooserDialogInterface *iface;
diff --git a/gedit/gedit-file-chooser-dialog.h b/gedit/gedit-file-chooser-dialog.h
index 3ec6f6d..4ea3a93 100644
--- a/gedit/gedit-file-chooser-dialog.h
+++ b/gedit/gedit-file-chooser-dialog.h
@@ -73,6 +73,7 @@ struct _GeditFileChooserDialogInterface
gboolean overwrite_confirmation);
void (*show) (GeditFileChooserDialog *dialog);
+ void (*hide) (GeditFileChooserDialog *dialog);
void (*destroy) (GeditFileChooserDialog *dialog);
@@ -144,6 +145,7 @@ void gedit_file_chooser_dialog_set_do_overwrite_confirmation (
gboolean
overwrite_confirmation);
void gedit_file_chooser_dialog_show (GeditFileChooserDialog *dialog);
+void gedit_file_chooser_dialog_hide (GeditFileChooserDialog *dialog);
void gedit_file_chooser_dialog_set_modal (GeditFileChooserDialog *dialog,
gboolean is_modal);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]