[Xfce4-commits] <thunar-actions-plugin:master> started again on the project in the new git

noik noreply at xfce.org
Mon Nov 2 17:28:01 CET 2009


Updating branch refs/heads/master
         to 9b10b55d4deae0371670eed05a9efed5b00e50f1 (commit)
       from 0d87bc8da4582368accad8efdf3adc2ea3e59e3d (commit)

commit 9b10b55d4deae0371670eed05a9efed5b00e50f1
Author: noik <noik00 at gmail.com>
Date:   Mon Nov 2 17:15:11 2009 +0100

    started again on the project in the new git

 module.xml                        |   21 +++++++
 thunar-actions-plugin/ta-window.c |  107 +++++++++++++++++++++++++++++++++++++
 thunar-actions-plugin/ta-window.h |   43 +++++++++++++++
 3 files changed, 171 insertions(+), 0 deletions(-)

diff --git a/module.xml b/module.xml
new file mode 100644
index 0000000..5c64b19
--- /dev/null
+++ b/module.xml
@@ -0,0 +1,21 @@
+<Project>
+	<name xml:lang="en">thunar-actions-plugin</name>
+	<shortdesc xml:lang="en">Thunar actions plugin with the use of .desktop files</shortdesc>
+	<homepage rdf:resource="http://goodies.xfce.org/projects/thunar-plugins/thunar-actions-plugin"/>
+	<maintainer>
+		<foaf:Person>
+			<foaf:name>Kees Scherpenhuijzen</foaf:name>
+			<foaf:mbox>mailto:noik00 at gmail.com</foaf:mbox>
+			<gnome:userid>noik</gnome:userid>
+		</foaf:Person>
+	</maintainer>
+
+  <developer>
+    <foaf:Person>
+      <foaf:name>Kees Scherpenhuijzen</foaf:name>
+      <foaf:mbox>mailto:noik00 at gmail.com</foaf:mbox>
+      <gnome:userid>noik</gnome:userid>
+    </foaf:Person>
+  </developer>
+
+</Project>
diff --git a/thunar-actions-plugin/ta-window.c b/thunar-actions-plugin/ta-window.c
new file mode 100644
index 0000000..3de70cf
--- /dev/null
+++ b/thunar-actions-plugin/ta-window.c
@@ -0,0 +1,107 @@
+/* $Id$ */
+/*-
+ * Copyright (c) 2005-2006 Benedikt Meurer <benny at xfce.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "ta-window.h"
+
+static void thunar_ta_window_response(GtkDialog *, gint);
+static gboolean thunar_ta_window_key_press_event (GtkWidget *, GdkEventKey *);
+
+
+struct _ThunarTaWindowClass
+{
+  GtkDialogClass __parent__;
+};
+
+struct _ThunarTaWindow
+{
+  GtkDialog __parent__;
+
+  GtkWidget   *treeview;
+  GtkWidget   *add_button;
+  GtkWidget   *edit_button;
+  GtkWidget   *delete_button;
+  GtkWidget   *up_button;
+  GtkWidget   *down_button;
+};
+
+THUNARX_DEFINE_TYPE (ThunarTaWindow, thunar_ta_window, GTK_TYPE_DIALOG);
+
+static void thunar_ta_window_class_init (ThunarTaWindowClass *klass)
+{
+  GtkDialogClass *gtkdialog_class;
+  GtkWidgetClass *gtkwidget_class;
+
+  gtkwidget_class = GTK_WIDGET_CLASS (klass);
+  gtkwidget_class->key_press_event = thunar_ta_window_key_press_event;
+
+  gtkdialog_class = GTK_DIALOG_CLASS (klass);
+  gtkdialog_class->response = thunar_ta_window_response;
+}
+
+
+
+static void thunar_ta_window_init (ThunarTaWindow *ta_window)
+{
+  //GtkTreeViewColumn *column;
+  //GtkTreeSelection  *selection;
+  //GtkCellRenderer   *renderer;
+  //ThunarUcaModel    *uca_model;
+  //GtkWidget         *image;
+  //GtkWidget         *label;
+  //GtkWidget         *hbox;
+  //GtkWidget         *swin;
+  //GtkWidget         *vbox;
+
+  gtk_dialog_add_button(GTK_DIALOG(ta_window), GTK_STOCK_HELP, GTK_RESPONSE_HELP);
+  gtk_dialog_add_button(GTK_DIALOG(ta_window), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
+  gtk_dialog_set_default_response (GTK_DIALOG(ta_window), GTK_RESPONSE_CLOSE);
+
+
+  gtk_window_set_default_size (GTK_WINDOW (ta_window), 500, 300);
+  gtk_window_set_destroy_with_parent (GTK_WINDOW (ta_window), TRUE);
+  gtk_window_set_title (GTK_WINDOW (ta_window), "Test");//TODO: _() for translation
+}
+
+
+static void thunar_ta_window_response(GtkDialog *dialog, gint response) {
+    if (response == GTK_RESPONSE_CLOSE)
+    {
+      gtk_widget_destroy (GTK_WIDGET (dialog));
+    }
+  else if (GTK_DIALOG_CLASS (thunar_ta_window_parent_class)->response != NULL)
+    {
+      (*GTK_DIALOG_CLASS (thunar_ta_window_parent_class)->response) (dialog, response);
+    }
+}
+
+static gboolean thunar_ta_window_key_press_event (GtkWidget *widget, GdkEventKey *event) {
+  /* close chooser window on Esc key press */
+  /*if (G_UNLIKELY (event->keyval == GDK_Escape))
+    {
+      gtk_dialog_response (GTK_DIALOG (widget), GTK_RESPONSE_CLOSE);
+      return TRUE;
+    }*/
+
+  return (*GTK_WIDGET_CLASS (thunar_ta_window_parent_class)->key_press_event) (widget, event);
+}
diff --git a/thunar-actions-plugin/ta-window.h b/thunar-actions-plugin/ta-window.h
new file mode 100644
index 0000000..cf8ac17
--- /dev/null
+++ b/thunar-actions-plugin/ta-window.h
@@ -0,0 +1,43 @@
+/* $Id$ */
+/*-
+ * Copyright (c) 2009 Kees Scherpenhuijzen <noik00 at gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __THUNAR_TA_WINDOW_H__
+#define __THUNAR_TA_WINDOW_H__
+
+#include <thunarx/thunarx.h>
+
+G_BEGIN_DECLS;
+
+typedef struct _ThunarTaWindowClass ThunarTaWindowClass;
+typedef struct _ThunarTaWindow      ThunarTaWindow;
+
+#define THUNAR_TA_TYPE_WINDOW             (thunar_ta_window_get_type ())
+#define THUNAR_TA_WINDOW(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), THUNAR_TA_TYPE_WINDOW, ThunarTaWindow))
+#define THUNAR_TA_WINDOW_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), THUNAR_TA_TYPE_WINDOW, ThunarTaWindowClass))
+#define THUNAR_TA_IS_WINDOW(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THUNAR_TA_TYPE_WINDOW))
+#define THUNAR_TA_IS_WINDOW_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), THUNAR_TA_TYPE_WINDOW))
+#define THUNAR_TA_WINDOW_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), THUNAR_TA_TYPE_WINDOW, ThunarTaWindowClass))
+
+GType      thunar_ta_window_get_type      (void) G_GNUC_CONST;
+void       thunar_ta_window_register_type (ThunarxProviderPlugin *plugin);
+
+G_END_DECLS;
+
+#endif /* !__THUNAR_TA_WINDOW_H__ */



More information about the Xfce4-commits mailing list