[Xfce4-commits] <xfce4-panel:devel> * Commit some stuff for the launcher plugin.
Nick Schermer
nick at xfce.org
Tue Aug 11 20:24:47 CEST 2009
Updating branch refs/heads/devel
to e5ba404febcf9ecbecd7e1b4881b1eb088727e09 (commit)
from 1bb25f2d3af9a7f2a0467c49906b4a11ddef0c95 (commit)
commit e5ba404febcf9ecbecd7e1b4881b1eb088727e09
Author: Nick Schermer <nick at xfce.org>
Date: Fri Oct 10 21:48:18 2008 +0200
* Commit some stuff for the launcher plugin.
plugins/launcher/Makefile.am | 18 ++++++---
plugins/launcher/launcher-dialog.c | 60 ++++++++++++++++++++++++++++
plugins/launcher/launcher-dialog.glade | 67 ++++++++++++++++----------------
plugins/launcher/launcher-dialog.h | 3 +
plugins/launcher/launcher.c | 4 +-
plugins/launcher/launcher.h | 5 +-
6 files changed, 115 insertions(+), 42 deletions(-)
diff --git a/plugins/launcher/Makefile.am b/plugins/launcher/Makefile.am
index 07ec54b..475653e 100644
--- a/plugins/launcher/Makefile.am
+++ b/plugins/launcher/Makefile.am
@@ -19,7 +19,8 @@ liblauncher_la_SOURCES = \
launcher.c \
launcher.h \
launcher-dialog.c \
- launcher-dialog.h
+ launcher-dialog.h \
+ launcher-dialog_glade.h
liblauncher_la_CFLAGS = \
$(GTK_CFLAGS) \
@@ -32,13 +33,9 @@ liblauncher_la_CFLAGS = \
liblauncher_la_LDFLAGS = \
-avoid-version \
-module \
+ -no-undefined \
$(PLATFORM_LDFLAGS)
-if HAVE_CYGWIN
-liblauncher_la_LDFLAGS += \
- -no-undefined
-endif
-
liblauncher_la_LIBADD = \
$(top_builddir)/libxfce4panel/libxfce4panel.la \
$(GTK_LIBS) \
@@ -50,6 +47,14 @@ liblauncher_la_LIBADD = \
liblauncher_la_DEPENDENCIES = \
$(top_builddir)/libxfce4panel/libxfce4panel.la
+if MAINTAINER_MODE
+BUILT_SOURCES = \
+ launcher-dialog_glade.h
+
+launcher-dialog_glade.h: launcher-dialog.glade
+ exo-csource --static --strip-comments --strip-content --name=launcher_dialog_glade $< >$@
+endif
+
#
# .desktop file
#
@@ -69,6 +74,7 @@ desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
@INTLTOOL_DESKTOP_RULE@
EXTRA_DIST = \
+ launcher-dialog.glade \
$(desktop_in_in_files)
DISTCLEANFILES = \
diff --git a/plugins/launcher/launcher-dialog.c b/plugins/launcher/launcher-dialog.c
index 2a0f4e2..8b3f0f7 100644
--- a/plugins/launcher/launcher-dialog.c
+++ b/plugins/launcher/launcher-dialog.c
@@ -15,3 +15,63 @@
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <exo/exo.h>
+#include <libxfce4ui/libxfce4ui.h>
+
+#include "launcher.h"
+#include "launcher-dialog.h"
+#include "launcher-dialog_glade.h"
+
+static void
+launcher_dialog_builder_died (gpointer user_data, GObject *where_object_was)
+{
+ g_message ("builder destroyed");
+}
+
+
+
+static void
+test_binding (GObject *object,
+ const gchar *property,
+ GType property_type,
+ gpointer struct_p,
+ glong struct_offset)
+{
+
+}
+
+
+
+
+void
+launcher_dialog_show (LauncherPlugin *plugin)
+{
+ GtkBuilder *builder;
+ GObject *dialog;
+ GObject *object;
+
+ panel_return_if_fail (XFCE_IS_LAUNCHER_PLUGIN (plugin));
+
+ builder = gtk_builder_new ();
+ g_object_weak_ref (G_OBJECT (builder), launcher_dialog_builder_died, NULL);
+ if (gtk_builder_add_from_string (builder, launcher_dialog_glade, launcher_dialog_glade_length, NULL))
+ {
+ dialog = gtk_builder_get_object (builder, "dialog");
+ g_object_weak_ref (G_OBJECT (dialog), (GWeakNotify) g_object_unref, builder);
+ gtk_widget_show (GTK_WIDGET (dialog));
+
+
+ object = gtk_builder_get_object (builder, "close-button");
+ g_signal_connect_swapped (G_OBJECT (object), "clicked", G_CALLBACK (gtk_widget_destroy), dialog);
+
+ plugin->test = "blaat";
+
+ guint offset = G_STRUCT_OFFSET (LauncherPlugin, test);
+
+ g_message ("%d %s", offset, G_STRUCT_MEMBER (gchar *, plugin, offset));
+ }
+}
diff --git a/plugins/launcher/launcher-dialog.glade b/plugins/launcher/launcher-dialog.glade
index 6b61771..5a1ffd7 100644
--- a/plugins/launcher/launcher-dialog.glade
+++ b/plugins/launcher/launcher-dialog.glade
@@ -1,14 +1,15 @@
<?xml version="1.0"?>
<interface>
<!--interface-requires gtk+ 2.12-->
- <object class="GtkDialog" id="xfce-launcher-dialog">
- <property name="title" translatable="yes">Launcher Preferences</property>
- <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
- <property name="icon_name">gtk-preferences</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <!--interface-requires xfce4 0.0-->
+ <object class="XfceTitledDialog" id="dialog">
+ <property name="title" translatable="yes">Launcher Properties</property>
+ <property name="window_position">GTK_WIN_POS_CENTER</property>
+ <property name="icon_name">gtk-properties</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
- <object class="GtkVBox" id="dialog-vbox1">
+ <object class="GtkVBox" id="dialog-vbox2">
<property name="visible">True</property>
<property name="spacing">2</property>
<child>
@@ -33,11 +34,10 @@
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<child>
- <object class="GtkTreeView" id="launchers-treeview">
+ <object class="GtkTreeView" id="entry-treeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">False</property>
- <property name="headers_clickable">False</property>
</object>
</child>
</object>
@@ -50,7 +50,7 @@
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
- <object class="GtkButton" id="launchers-up">
+ <object class="GtkButton" id="entry-up">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -67,7 +67,7 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="launchers-down">
+ <object class="GtkButton" id="entry-down">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -92,7 +92,7 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="launchers-add">
+ <object class="GtkButton" id="entry-add">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -109,7 +109,7 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="launchers-remove">
+ <object class="GtkButton" id="entry-remove">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -155,7 +155,7 @@
<property name="xalign">0</property>
<property name="label" translatable="yes">_Name:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">launcher-name</property>
+ <property name="mnemonic_widget">entry-name</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
@@ -168,7 +168,7 @@
<property name="xalign">0</property>
<property name="label" translatable="yes">_Description:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">launcher-description</property>
+ <property name="mnemonic_widget">entry-description</property>
</object>
<packing>
<property name="top_attach">1</property>
@@ -183,7 +183,7 @@
<property name="xalign">0</property>
<property name="label" translatable="yes">_Icon:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">launcher-icon</property>
+ <property name="mnemonic_widget">entry-icon</property>
</object>
<packing>
<property name="top_attach">2</property>
@@ -198,7 +198,7 @@
<property name="xalign">0</property>
<property name="label" translatable="yes">Co_mmand:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">launcher-command</property>
+ <property name="mnemonic_widget">entry-command</property>
</object>
<packing>
<property name="top_attach">3</property>
@@ -213,7 +213,7 @@
<property name="xalign">0</property>
<property name="label" translatable="yes">_Working Directory:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">launcher-working-directory</property>
+ <property name="mnemonic_widget">entry-working-directory</property>
</object>
<packing>
<property name="top_attach">4</property>
@@ -234,7 +234,7 @@
</packing>
</child>
<child>
- <object class="GtkEntry" id="launcher-name">
+ <object class="GtkEntry" id="entry-name">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
@@ -245,7 +245,7 @@
</packing>
</child>
<child>
- <object class="GtkEntry" id="launcher-description">
+ <object class="GtkEntry" id="entry-description">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
@@ -258,7 +258,7 @@
</packing>
</child>
<child>
- <object class="GtkEntry" id="launcher-command">
+ <object class="GtkEntry" id="entry-command">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
@@ -271,7 +271,7 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="launcher-command-select">
+ <object class="GtkButton" id="entry-command-select">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -293,7 +293,7 @@
</packing>
</child>
<child>
- <object class="GtkFileChooserButton" id="launcher-working-directory">
+ <object class="GtkFileChooserButton" id="entry-working-directory">
<property name="visible">True</property>
<property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property>
<property name="title" translatable="yes">Select A Working Directory</property>
@@ -307,7 +307,7 @@
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="launcher-in-terminal">
+ <object class="GtkCheckButton" id="entry-run-in-terminal">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Run in _terminal</property>
@@ -323,7 +323,7 @@
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="launcher-startup-notify">
+ <object class="GtkCheckButton" id="entry-startup-notify">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Use _statup notification</property>
@@ -344,7 +344,7 @@
<property name="xalign">0</property>
<property name="xscale">0</property>
<child>
- <object class="GtkButton" id="launcher-icon">
+ <object class="GtkButton" id="entry-icon">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -391,7 +391,7 @@
<property name="border_width">6</property>
<property name="spacing">6</property>
<child>
- <object class="GtkCheckButton" id="advanced-disable-tooltips">
+ <object class="GtkCheckButton" id="adv-disable-tooltips">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Disable t_ooltips</property>
@@ -404,7 +404,7 @@
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="advanced-show-labels">
+ <object class="GtkCheckButton" id="adv-show-labels">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Show _labels instead of icons</property>
@@ -417,10 +417,11 @@
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="advanced-show-last-used">
+ <object class="GtkCheckButton" id="adv-show-last-used">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Show last used entry in panel</property>
+ <property name="label" translatable="yes">Show last _used entry in panel</property>
+ <property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
@@ -437,7 +438,7 @@
<property name="visible">True</property>
<property name="label" translatable="yes">_Arrow button position:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">advanced-arrow-position</property>
+ <property name="mnemonic_widget">adv-arrow-position</property>
</object>
<packing>
<property name="expand">False</property>
@@ -445,7 +446,7 @@
</packing>
</child>
<child>
- <object class="GtkComboBox" id="advanced-arrow-position">
+ <object class="GtkComboBox" id="adv-arrow-position">
<property name="visible">True</property>
<property name="button_sensitivity">GTK_SENSITIVITY_ON</property>
</object>
@@ -481,11 +482,11 @@
</packing>
</child>
<child internal-child="action_area">
- <object class="GtkHButtonBox" id="dialog-action_area1">
+ <object class="GtkHButtonBox" id="dialog-action_area2">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
- <object class="GtkButton" id="button1">
+ <object class="GtkButton" id="close-button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
diff --git a/plugins/launcher/launcher-dialog.h b/plugins/launcher/launcher-dialog.h
index d90f7ac..f5bef00 100644
--- a/plugins/launcher/launcher-dialog.h
+++ b/plugins/launcher/launcher-dialog.h
@@ -18,5 +18,8 @@
#ifndef __XFCE_LAUNCHER_DIALOG_H__
#define __XFCE_LAUNCHER_DIALOG_H__
+#include "launcher.h"
+
+void launcher_dialog_show (LauncherPlugin *plugin);
#endif /* !__XFCE_LAUNCHER_DIALOG_H__ */
diff --git a/plugins/launcher/launcher.c b/plugins/launcher/launcher.c
index d6d7e4b..7d73890 100644
--- a/plugins/launcher/launcher.c
+++ b/plugins/launcher/launcher.c
@@ -24,6 +24,7 @@
#include <libxfce4ui/libxfce4ui.h>
#include "launcher.h"
+#include "launcher-dialog.h"
#define MENU_POPUP_DELAY (225)
#define ARROW_BUTTON_SIZE (16)
@@ -378,7 +379,8 @@ launcher_plugin_save (XfcePanelPlugin *panel_plugin)
static void
launcher_plugin_configure_plugin (XfcePanelPlugin *panel_plugin)
{
-
+ /* run the configure dialog */
+ launcher_dialog_show (XFCE_LAUNCHER_PLUGIN (panel_plugin));
}
diff --git a/plugins/launcher/launcher.h b/plugins/launcher/launcher.h
index 02c44d4..fec8b09 100644
--- a/plugins/launcher/launcher.h
+++ b/plugins/launcher/launcher.h
@@ -85,6 +85,7 @@ struct _LauncherPlugin
/* whether the menu appends in revered order */
guint menu_reversed_order : 1;
+ gchar *test;
};
struct _LauncherPluginEntry
@@ -112,9 +113,9 @@ static const GtkTargetEntry drop_targets[] =
GType launcher_plugin_get_type (void) G_GNUC_CONST;
-void launcher_plugin_rebuild (LauncherPlugin *plugin, gboolean update_icon);
+void launcher_plugin_rebuild (LauncherPlugin *plugin, gboolean update_icon);
-GSList *launcher_plugin_filenames_from_selection_data (GtkSelectionData *selection_data);
+GSList *launcher_plugin_filenames_from_selection_data (GtkSelectionData *selection_data);
GdkPixbuf *launcher_plugin_load_pixbuf (const gchar *name, gint size, GtkIconTheme *icon_theme);
More information about the Xfce4-commits
mailing list