[Xfce4-commits] xfce4-panel:master l10n: Updated Polish (pl) translation to 96%

2013-04-04 Thread Transifex
Updating branch refs/heads/master
 to c71954bd92a9db9046b51c422c86f6061727cb6c (commit)
   from d243dceef146ab61cf82066b548cad7b981d7b6e (commit)

commit c71954bd92a9db9046b51c422c86f6061727cb6c
Author: Piotr Sokół pso...@jabster.pl
Date:   Thu Apr 4 11:30:11 2013 +0200

l10n: Updated Polish (pl) translation to 96%

New status: 378 messages complete with 0 fuzzies and 13 untranslated.

Transmitted-via: Transifex (translations.xfce.org).

 po/pl.po |   74 ++---
 1 files changed, 36 insertions(+), 38 deletions(-)

diff --git a/po/pl.po b/po/pl.po
index 7afc4f0..0177534 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -7,21 +7,22 @@
 # Piotr Maliński riklau...@gmail.com, 2006.
 # Szymon Kałasz szymon_maes...@gazeta.pl, 2006.
 # Piotr Sokół pso...@jabster.pl, 2009, 2010, 2011, 2012, 2013.
-# 
+#
 msgid 
 msgstr 
 Project-Id-Version: xfce4-panel 4.10.0\n
 Report-Msgid-Bugs-To: \n
-POT-Creation-Date: 2013-03-20 17:15+\n
-PO-Revision-Date: 2013-03-10 14:15+0100\n
+POT-Creation-Date: 2013-04-04 05:00+\n
+PO-Revision-Date: 2013-04-04 11:27+0200\n
 Last-Translator: Piotr Sokół pso...@jabster.pl\n
 Language-Team: polski \n
+Language: \n
 MIME-Version: 1.0\n
 Content-Type: text/plain; charset=UTF-8\n
 Content-Transfer-Encoding: 8bits\n
-Language: \n
 X-Generator: Gtranslator 2.91.5\n
-Plural-Forms: nplurals=3; plural=((n==1) ? 0 : ((n%10=2  n%10=4  
(n%10010 || n%100=20)) ? 1 : 2));\n
+Plural-Forms: nplurals=3; plural=((n==1) ? 0 : ((n%10=2  n%10=4  (n
+%10010 || n%100=20)) ? 1 : 2));\n
 
 #: ../panel-desktop-handler.desktop.in.h:1
 msgid 
@@ -45,38 +46,38 @@ msgid Panel
 msgstr Panel
 
 #. I18N: %s is the name of the plugin
-#: ../libxfce4panel/xfce-panel-plugin.c:1037
+#: ../libxfce4panel/xfce-panel-plugin.c:1029
 #: ../panel/panel-preferences-dialog.c:1099
 #, c-format
 msgid Are you sure that you want to remove \%s\?
 msgstr Usunąć aplet „%s”?
 
-#: ../libxfce4panel/xfce-panel-plugin.c:1042
+#: ../libxfce4panel/xfce-panel-plugin.c:1034
 #: ../panel/panel-preferences-dialog.c:1102
 msgid If you remove the item from the panel, it is permanently lost.
 msgstr Aplet zostanie bezpowrotnie usunięty.
 
 #. move item
-#: ../libxfce4panel/xfce-panel-plugin.c:1202
+#: ../libxfce4panel/xfce-panel-plugin.c:1194
 msgid _Move
 msgstr _Przemieść
 
-#: ../libxfce4panel/xfce-panel-plugin.c:1236
+#: ../libxfce4panel/xfce-panel-plugin.c:1228
 msgid Pane_l
 msgstr Pane_l
 
 #. add new items
-#: ../libxfce4panel/xfce-panel-plugin.c:1244 ../panel/panel-window.c:2365
+#: ../libxfce4panel/xfce-panel-plugin.c:1236 ../panel/panel-window.c:2365
 msgid Add _New Items...
 msgstr _Dodaj aplet...
 
 #. customize panel
-#: ../libxfce4panel/xfce-panel-plugin.c:1255 ../panel/panel-window.c:2376
+#: ../libxfce4panel/xfce-panel-plugin.c:1247 ../panel/panel-window.c:2376
 msgid Panel Pr_eferences...
 msgstr P_referencje...
 
 #. logout item
-#: ../libxfce4panel/xfce-panel-plugin.c:1272 ../panel/panel-window.c:2404
+#: ../libxfce4panel/xfce-panel-plugin.c:1264 ../panel/panel-window.c:2404
 msgid Log _Out
 msgstr Za_kończ sesję
 
@@ -465,8 +466,7 @@ msgstr _Długość (%):
 msgid M_ode:
 msgstr _Układ:
 
-#. I18N: name of the section (frame) in the panel preferences where the user
-#. can define the length and size of the panel
+#. I18N: name of the section (frame) in the panel preferences where the user 
can define the length and size of the panel
 #: ../panel/panel-preferences-dialog.glade.h:22
 msgid Measurements
 msgstr Wymiary
@@ -941,23 +941,23 @@ msgstr I_kona:
 msgid _Show button title
 msgstr _Etykieta przycisku
 
-#: ../plugins/applicationsmenu/applicationsmenu.c:565
+#: ../plugins/applicationsmenu/applicationsmenu.c:557
 #: ../plugins/directorymenu/directorymenu.c:388
 msgid Select An Icon
 msgstr Wybór ikony
 
-#: ../plugins/applicationsmenu/applicationsmenu.c:603
-#: ../plugins/applicationsmenu/applicationsmenu.c:844
+#: ../plugins/applicationsmenu/applicationsmenu.c:598
+#: ../plugins/applicationsmenu/applicationsmenu.c:839
 #: ../plugins/clock/clock.c:865 ../plugins/launcher/launcher.c:2308
 #, c-format
 msgid Failed to execute command \%s\.
 msgstr Nie udało się wykonać polecenia „%s”.
 
-#: ../plugins/applicationsmenu/applicationsmenu.c:1113
+#: ../plugins/applicationsmenu/applicationsmenu.c:1108
 msgid No applications found
 msgstr Nie odnaleziono programów
 
-#: ../plugins/applicationsmenu/applicationsmenu.c:1136
+#: ../plugins/applicationsmenu/applicationsmenu.c:1131
 msgid Failed to load the applications menu
 msgstr Nie udało się wczytać menu programów
 
@@ -1040,8 +1040,7 @@ msgstr _Sekundy
 msgid F_ormat:
 msgstr F_ormat:
 
-#. I18N: the fuzziness the *precision* of the fuzzy clock. Time steps of 5, 15
-#. or parts of the day.
+#. I18N: the fuzziness the *precision* of the fuzzy clock. Time steps of 5, 15 
or parts of the day.
 #: ../plugins/clock/clock-dialog.glade.h:11
 msgid F_uzziness:
 msgstr Stopień _rozmycia:
@@ -1059,13 +1058,12 @@ msgid 

[Xfce4-commits] xfce4-indicator-plugin:master Reworked entry_removed handler

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to d59fbfc202bd55d0821037b250e89cb31100457e (commit)
   from 2bf70a11a8707924c3a2e3cf2ff265a4f0410f9b (commit)

commit d59fbfc202bd55d0821037b250e89cb31100457e
Author: Andrzej ndrwr...@gmail.com
Date:   Thu Mar 29 23:49:06 2012 +0900

Reworked entry_removed handler

 panel-plugin/indicator-box.c|   23 +++
 panel-plugin/indicator-box.h|   12 ++--
 panel-plugin/indicator-button.h |4 
 panel-plugin/indicator.c|   17 +
 4 files changed, 42 insertions(+), 14 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index 95376dd..700a218 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -519,3 +519,26 @@ xfce_indicator_box_get_row_size (XfceIndicatorBox *box)
 
   return MIN (box-panel_size / box-nrows, box-icon_size_max + 
border_thickness);
 }
+
+
+XfceIndicatorButton *
+xfce_indicator_box_get_button (XfceIndicatorBox *box,
+   IndicatorObjectEntry *entry)
+{
+  GSList  *li;
+  GtkWidget   *child;
+  XfceIndicatorButton *button;
+
+  g_return_val_if_fail (XFCE_IS_INDICATOR_BOX (box), NULL);
+
+  for (li = box-children; li != NULL; li = li-next)
+{
+  child = GTK_WIDGET (li-data);
+  g_return_val_if_fail (XFCE_IS_INDICATOR_BUTTON (child), NULL);
+
+  button = XFCE_INDICATOR_BUTTON (child);
+  if (xfce_indicator_button_get_entry (button) == entry)
+return button;
+}
+  return NULL;
+}
diff --git a/panel-plugin/indicator-box.h b/panel-plugin/indicator-box.h
index b28c9d2..e302279 100644
--- a/panel-plugin/indicator-box.h
+++ b/panel-plugin/indicator-box.h
@@ -18,6 +18,11 @@
 #ifndef __INDICATOR_BOX_H__
 #define __INDICATOR_BOX_H__
 
+#include glib.h
+#include gtk/gtk.h
+#include libindicator/indicator-object.h
+#include indicator-button.h
+
 G_BEGIN_DECLS
 
 GType xfce_indicator_box_get_type (void);
@@ -51,14 +56,17 @@ struct _XfceIndicatorBoxClass
   GtkContainerClass __parent__;
 };
 
-void xfce_indicator_box_set_orientation (XfceIndicatorBox *button,
+void xfce_indicator_box_set_orientation (XfceIndicatorBox *box,
  GtkOrientation panel_orientation,
  GtkOrientation orientation);
 
-void xfce_indicator_box_set_size (XfceIndicatorBox *button,
+void xfce_indicator_box_set_size (XfceIndicatorBox *box,
   gint panel_size,
   gint nrows);
 
+XfceIndicatorButton *xfce_indicator_box_get_button (XfceIndicatorBox *box,
+IndicatorObjectEntry 
*entry);
+
 GtkWidget *xfce_indicator_box_new ();
 
 G_END_DECLS
diff --git a/panel-plugin/indicator-button.h b/panel-plugin/indicator-button.h
index 80e93fb..129aa22 100644
--- a/panel-plugin/indicator-button.h
+++ b/panel-plugin/indicator-button.h
@@ -18,6 +18,10 @@
 #ifndef __INDICATOR_BUTTON_H__
 #define __INDICATOR_BUTTON_H__
 
+#include glib.h
+#include gtk/gtk.h
+#include libindicator/indicator-object.h
+
 G_BEGIN_DECLS
 
 GType xfce_indicator_button_get_type (void);
diff --git a/panel-plugin/indicator.c b/panel-plugin/indicator.c
index e0b2551..e1047cc 100644
--- a/panel-plugin/indicator.c
+++ b/panel-plugin/indicator.c
@@ -361,21 +361,14 @@ entry_added (IndicatorObject * io, IndicatorObjectEntry * 
entry, gpointer user_d
 
 
 static void
-entry_removed_cb (GtkWidget * widget, gpointer userdata)
+entry_removed (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer 
user_data)
 {
-  gpointer data = (gpointer) xfce_indicator_button_get_entry 
(XFCE_INDICATOR_BUTTON (widget));
-
-  if (data != userdata)
-return;
-
-  gtk_widget_destroy(widget);
-}
+  XfceIndicatorButton *button;
 
+  button = xfce_indicator_box_get_button (XFCE_INDICATOR_BOX (user_data), 
entry);
 
-static void
-entry_removed (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer 
user_data)
-{
-  gtk_container_foreach(GTK_CONTAINER(user_data), entry_removed_cb, entry);
+  if (button != NULL)
+gtk_widget_destroy (GTK_WIDGET (button));
 }
 
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-indicator-plugin:master Making the plugin a library and a subclass of XfcePanelPlugin

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to f84d012dc997211a43236325bca50dc7092ec3e3 (commit)
   from d59fbfc202bd55d0821037b250e89cb31100457e (commit)

commit f84d012dc997211a43236325bca50dc7092ec3e3
Author: Andrzej ndrwr...@gmail.com
Date:   Sat Mar 31 21:57:43 2012 +0900

Making the plugin a library and a subclass of XfcePanelPlugin

The plugin is now installed as a library and to a different directory
(following convention of other plugins).

The plugin is now an object of IndicatorPlugin class, which extends
XfcePanelPlugin. This is for making definition of properties and integration
with xfconf easier.

Conflicts:

panel-plugin/indicator.c

 configure.in.in|7 +
 panel-plugin/Makefile.am   |   55 ---
 panel-plugin/indicator.c   |  165 
 ...ndicator.desktop.in.in = indicator.desktop.in} |4 +-
 panel-plugin/indicator.h   |   32 ++--
 5 files changed, 158 insertions(+), 105 deletions(-)

diff --git a/configure.in.in b/configure.in.in
index 3280c7f..b308dbd 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -30,6 +30,7 @@ dnl ***
 AM_INIT_AUTOMAKE([1.8 dist-bzip2 tar-ustar])
 AM_CONFIG_HEADER([config.h])
 AM_MAINTAINER_MODE()
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
 dnl 
 dnl *** Check for basic programs ***
@@ -40,6 +41,12 @@ AC_PROG_INSTALL()
 AC_PROG_LIBTOOL()
 AC_PROG_INTLTOOL()
 
+dnl **
+dnl *** Initialize libtool ***
+dnl **
+LT_PREREQ([2.2.6])
+LT_INIT([disable-static])
+
 dnl **
 dnl *** Check for standard headers ***
 dnl **
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index c07a45c..0010923 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -1,19 +1,24 @@
+
 INCLUDES = 
\
-I$(top_srcdir) 
\
-   -DG_LOG_DOMAIN=\xfce4-indicator-plugin\   \
+   -DG_LOG_DOMAIN=\libindicator-plugin\  \
-DPACKAGE_LOCALE_DIR=\$(localedir)\   \
$(PLATFORM_CPPFLAGS)
 
 #
 # Indicator plugin
 #
-plugin_PROGRAMS =  
\
-   xfce4-indicator-plugin
+plugindir = \
+   $(libdir)/xfce4/panel/plugins
+
+plugin_LTLIBRARIES = \
+   libindicator-plugin.la
 
-plugindir =
\
-   $(libexecdir)/xfce4/panel-plugins
+libindicator_built_sources = \
+   indicator-dialog_ui.h
 
-xfce4_indicator_plugin_SOURCES =   \
+libindicator_plugin_la_SOURCES = \
+   $(libindicator_built_sources) \
indicator-button.c  
\
indicator-button.h  
\
indicator-box.c 
\
@@ -21,7 +26,7 @@ xfce4_indicator_plugin_SOURCES =  
\
indicator.c 
\
indicator.h 

 
-xfce4_indicator_plugin_CFLAGS =\
+libindicator_plugin_la_CFLAGS = \
$(GTK_CFLAGS) \
$(EXO_CFLAGS) \
$(LIBXFCE4UTIL_CFLAGS)  \
@@ -33,8 +38,14 @@ xfce4_indicator_plugin_CFLAGS =  
\
-DINDICATOR_ICONS_DIR=\$(INDICATORICONSDIR)\ \
-DINDICATOR_DIR=\$(INDICATORDIR)\
 
+libindicator_plugin_la_LDFLAGS = \
+   -avoid-version \
+   -module \
+   -no-undefined \
+   -export-symbols-regex '^xfce_panel_module_(preinit|init|construct)' \
+   $(PLATFORM_LDFLAGS)
 
-xfce4_indicator_plugin_LDADD = \
+libindicator_plugin_la_LIBADD = \
$(GTK_LIBS) \
$(EXO_LIBS) \
$(LIBXFCE4UTIL_LIBS)\
@@ -46,16 +57,10 @@ xfce4_indicator_plugin_LDADD =  
\
 # Desktop file
 #
 desktopdir =   
\
-   $(datadir)/xfce4/panel-plugins
-
-desktop_in_in_files =  \
-   indicator.desktop.in.in
-
-desktop_in_files = 
\
-   $(desktop_in_in_files:.desktop.in.in=.desktop.in)
+   $(datadir)/xfce4/panel/plugins
 
-%.desktop.in: %.desktop.in.in
-   sed -e s,\@libexecdir\@,$(libexecdir),g  $  $@

[Xfce4-commits] xfce4-indicator-plugin:master Reverted glade related change - not ready yet.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 02a4e03020680a20333035397f49f99186941635 (commit)
   from f84d012dc997211a43236325bca50dc7092ec3e3 (commit)

commit 02a4e03020680a20333035397f49f99186941635
Author: Andrzej ndrwr...@gmail.com
Date:   Sat Mar 31 23:57:38 2012 +0900

Reverted glade related change - not ready yet.

 panel-plugin/Makefile.am |   15 ---
 1 files changed, 0 insertions(+), 15 deletions(-)

diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index 0010923..f0697e1 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -14,11 +14,7 @@ plugindir = \
 plugin_LTLIBRARIES = \
libindicator-plugin.la
 
-libindicator_built_sources = \
-   indicator-dialog_ui.h
-
 libindicator_plugin_la_SOURCES = \
-   $(libindicator_built_sources) \
indicator-button.c  
\
indicator-button.h  
\
indicator-box.c 
\
@@ -73,15 +69,4 @@ EXTRA_DIST = 
\
 DISTCLEANFILES = \
$(desktop_DATA)
 
-if MAINTAINER_MODE
-BUILT_SOURCES = \
-   $(libindicator_plugin_built_sources)
-
-DISTCLEANFILES += \
-   $(libindicator_plugin_built_sources)
-
-indicator-dialog_ui.h: indicator-dialog.glade
-   $(AM_V_GEN) exo-csource --static --strip-comments --strip-content 
--name=indicator_dialog_ui $ $@
-endif
-
 # vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-indicator-plugin:master Added comments.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to e79f2b355ddb6600fbea0ebebb03ade066807842 (commit)
   from 44ef2fa54ba164b9b434b01d82ca739b4b49a9ce (commit)

commit e79f2b355ddb6600fbea0ebebb03ade066807842
Author: Andrzej ndrwr...@gmail.com
Date:   Sun Apr 1 03:07:06 2012 +0900

Added comments.

 panel-plugin/indicator-box.c|9 +
 panel-plugin/indicator-button.c |   10 ++
 panel-plugin/indicator-dialog.c |9 +
 panel-plugin/indicator.c|9 +
 4 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index 700a218..0643a3f 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -15,6 +15,15 @@
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+
+
+/*
+ *  This file implements a container class for holding indicator buttons.
+ *
+ */
+
+
+
 #include glib.h
 #include gtk/gtk.h
 #include exo/exo.h
diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 9763da5..c89bdaf 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -15,6 +15,16 @@
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+
+
+/*
+ *  This file implements an indicator button class corresponding to
+ *  a single indicator object entry.
+ *
+ */
+
+
+
 #include glib.h
 #include gtk/gtk.h
 #include libxfce4panel/libxfce4panel.h
diff --git a/panel-plugin/indicator-dialog.c b/panel-plugin/indicator-dialog.c
index 0ad6c04..a2241c5 100644
--- a/panel-plugin/indicator-dialog.c
+++ b/panel-plugin/indicator-dialog.c
@@ -16,6 +16,15 @@
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+
+
+/*
+ *  This file implements a preferences dialog. The class extends GtkBuilder.
+ *
+ */
+
+
+
 #ifdef HAVE_CONFIG_H
 #include config.h
 #endif
diff --git a/panel-plugin/indicator.c b/panel-plugin/indicator.c
index c51603e..9d2bc52 100644
--- a/panel-plugin/indicator.c
+++ b/panel-plugin/indicator.c
@@ -15,6 +15,15 @@
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+
+
+/*
+ *  This file implements the main plugin class.
+ *
+ */
+
+
+
 #ifdef HAVE_CONFIG_H
 #include config.h
 #endif
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-indicator-plugin:master Experiment with preferences dialog.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 44ef2fa54ba164b9b434b01d82ca739b4b49a9ce (commit)
   from 02a4e03020680a20333035397f49f99186941635 (commit)

commit 44ef2fa54ba164b9b434b01d82ca739b4b49a9ce
Author: Andrzej ndrwr...@gmail.com
Date:   Sun Apr 1 03:06:19 2012 +0900

Experiment with preferences dialog.

Added an XfceIndicatorDialog class based on GtkBuilder.
Added dependency on libxfce4ui (v.4.8 - not checked if earlier revisions
work)

The UI file (stub) was copied from the systray plugin.

 configure.in.in |1 +
 panel-plugin/Makefile.am|   19 +++
 panel-plugin/indicator-dialog.c |  172 
 panel-plugin/indicator-dialog.glade |  293 +++
 panel-plugin/indicator-dialog.h |   43 +
 panel-plugin/indicator.c|   26 +++-
 panel-plugin/indicator.h|8 +-
 7 files changed, 558 insertions(+), 4 deletions(-)

diff --git a/configure.in.in b/configure.in.in
index b308dbd..e2bdeaf 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -74,6 +74,7 @@ dnl ***
 XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.14.0])
 XDT_CHECK_PACKAGE([EXO], [exo-1], [0.6.0])
 XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.3.99.2])
+XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.8.0])
 XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.3.99.2])
 XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.6.0])
 XDT_CHECK_PACKAGE([INDICATOR], [indicator], [0.3.0], 
[indicator_pkgname=indicator], [XDT_CHECK_PACKAGE([INDICATOR], [indicator-0.4], 
[0.3.90], [indicator_pkgname=indicator-0.4], [])])
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index f0697e1..80c33f0 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -14,11 +14,17 @@ plugindir = \
 plugin_LTLIBRARIES = \
libindicator-plugin.la
 
+libindicator_built_sources = \
+   indicator-dialog_ui.h
+
 libindicator_plugin_la_SOURCES = \
+   $(libindicator_built_sources) \
indicator-button.c  
\
indicator-button.h  
\
indicator-box.c 
\
indicator-box.h 
\
+   indicator-dialog.c \
+   indicator-dialog.h \
indicator.c 
\
indicator.h 

 
@@ -26,6 +32,7 @@ libindicator_plugin_la_CFLAGS = \
$(GTK_CFLAGS) \
$(EXO_CFLAGS) \
$(LIBXFCE4UTIL_CFLAGS)  \
+   $(LIBXFCE4UI_CFLAGS) \
$(LIBXFCE4PANEL_CFLAGS) \
$(XFCONF_CFLAGS)\
$(INDICATOR_CFLAGS) \
@@ -45,6 +52,7 @@ libindicator_plugin_la_LIBADD = \
$(GTK_LIBS) \
$(EXO_LIBS) \
$(LIBXFCE4UTIL_LIBS)\
+   $(LIBXFCE4UI_LIBS) \
$(LIBXFCE4PANEL_LIBS)   \
$(XFCONF_LIBS)  \
$(INDICATOR_LIBS)
@@ -69,4 +77,15 @@ EXTRA_DIST = 
\
 DISTCLEANFILES = \
$(desktop_DATA)
 
+if MAINTAINER_MODE
+BUILT_SOURCES = \
+   $(libindicator_built_sources)
+
+DISTCLEANFILES += \
+   $(libindicator_built_sources)
+
+indicator-dialog_ui.h: indicator-dialog.glade
+   $(AM_V_GEN) exo-csource --static --strip-comments --strip-content 
--name=indicator_dialog_ui $ $@
+endif
+
 # vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
diff --git a/panel-plugin/indicator-dialog.c b/panel-plugin/indicator-dialog.c
new file mode 100644
index 000..0ad6c04
--- /dev/null
+++ b/panel-plugin/indicator-dialog.c
@@ -0,0 +1,172 @@
+/*
+ *  Copyright (C) 2012 Andrzej ndrwr...@gmail.com
+ *
+ *  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
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef 

[Xfce4-commits] xfce4-indicator-plugin:master bugfix: fixed label orientation.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 81aecb3bc340f90b460d73f61d2ddea443416075 (commit)
   from c90af565ed597a79071ea2559451f2c781716cfd (commit)

commit 81aecb3bc340f90b460d73f61d2ddea443416075
Author: Andrzej ndrwr...@gmail.com
Date:   Mon Apr 2 11:00:42 2012 +0900

bugfix: fixed label orientation.

The error occurred in appmenu labels at switching the panel mode
from vertical to e.g. deskbar. There was a race condition between
setting the label and setting the button orientation.

 panel-plugin/indicator-button.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index c89bdaf..3b634cf 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -223,6 +223,8 @@ xfce_indicator_button_set_label (XfceIndicatorButton 
*button,
 
   button-label = GTK_WIDGET (label);
   g_object_ref (G_OBJECT (button-label));
+  gtk_label_set_angle (GTK_LABEL (button-label),
+   (button-orientation == GTK_ORIENTATION_VERTICAL) ? 
-90 : 0);
   gtk_box_pack_end (GTK_BOX (button-box), button-label, TRUE, FALSE, 1);
 }
   xfce_indicator_button_update_layout (button);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-indicator-plugin:master Reworked dialog UI.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to c90af565ed597a79071ea2559451f2c781716cfd (commit)
   from e79f2b355ddb6600fbea0ebebb03ade066807842 (commit)

commit c90af565ed597a79071ea2559451f2c781716cfd
Author: Andrzej ndrwr...@gmail.com
Date:   Sun Apr 1 23:41:53 2012 +0900

Reworked dialog UI.

 panel-plugin/indicator-dialog.glade |  313 +--
 1 files changed, 226 insertions(+), 87 deletions(-)

diff --git a/panel-plugin/indicator-dialog.glade 
b/panel-plugin/indicator-dialog.glade
index 7c715a4..5194a0d 100644
--- a/panel-plugin/indicator-dialog.glade
+++ b/panel-plugin/indicator-dialog.glade
@@ -1,4 +1,4 @@
-?xml version=1.0?
+?xml version=1.0 encoding=UTF-8?
 interface
   requires lib=gtk+ version=2.14/
   !-- interface-requires libxfce4ui 0.0 --
@@ -16,44 +16,93 @@
 /columns
   /object
   object class=XfceTitledDialog id=dialog
+property name=can_focusFalse/property
 property name=title translatable=yesIndicators/property
-property name=default_width325/property
-property name=default_height425/property
+property name=default_width425/property
+property name=default_height525/property
 property name=icon_namegtk-properties/property
 property name=type_hintnormal/property
 child internal-child=vbox
   object class=GtkVBox id=dialog-vbox2
 property name=visibleTrue/property
-property name=orientationvertical/property
+property name=can_focusFalse/property
 property name=spacing2/property
+child internal-child=action_area
+  object class=GtkHButtonBox id=dialog-action_area2
+property name=visibleTrue/property
+property name=can_focusFalse/property
+property name=layout_styleend/property
+child
+  object class=GtkButton id=close-button
+property name=labelgtk-close/property
+property name=visibleTrue/property
+property name=can_focusTrue/property
+property name=receives_defaultTrue/property
+property name=use_action_appearanceFalse/property
+property name=use_stockTrue/property
+  /object
+  packing
+property name=expandFalse/property
+property name=fillFalse/property
+property name=position0/property
+  /packing
+/child
+child
+  object class=GtkButton id=help-button
+property name=labelgtk-help/property
+property name=visibleTrue/property
+property name=can_focusTrue/property
+property name=receives_defaultTrue/property
+property name=use_action_appearanceFalse/property
+property name=use_stockTrue/property
+  /object
+  packing
+property name=expandFalse/property
+property name=fillFalse/property
+property name=position1/property
+property name=secondaryTrue/property
+  /packing
+/child
+  /object
+  packing
+property name=expandFalse/property
+property name=fillTrue/property
+property name=pack_typeend/property
+property name=position0/property
+  /packing
+/child
 child
   object class=GtkVBox id=vbox1
 property name=visibleTrue/property
+property name=can_focusFalse/property
 property name=border_width6/property
-property name=orientationvertical/property
 property name=spacing6/property
 child
   object class=GtkFrame id=frame3
 property name=visibleTrue/property
+property name=can_focusFalse/property
 property name=label_xalign0/property
 property name=shadow_typenone/property
 child
   object class=GtkAlignment id=alignment3
 property name=visibleTrue/property
+property name=can_focusFalse/property
 property name=left_padding12/property
 child
   object class=GtkVBox id=vbox2
 property name=visibleTrue/property
+property name=can_focusFalse/property
 property name=border_width6/property
-property name=orientationvertical/property
 property name=spacing6/property
 child
   object class=GtkHBox id=hbox1
 property name=visibleTrue/property
+property name=can_focusFalse/property
 property name=spacing12/property
 child
   

[Xfce4-commits] xfce4-indicator-plugin:master Cleaning some runtime GObject assert violations

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to d0bef06d946defc9fb2ae3682b1498092906713e (commit)
   from 81aecb3bc340f90b460d73f61d2ddea443416075 (commit)

commit d0bef06d946defc9fb2ae3682b1498092906713e
Author: Andrzej ndrwr...@gmail.com
Date:   Sun Apr 8 23:57:21 2012 +0900

Cleaning some runtime GObject assert violations

 panel-plugin/indicator-button.c |   42 --
 1 files changed, 13 insertions(+), 29 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 3b634cf..58810ad 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -93,35 +93,18 @@ xfce_indicator_button_finalize (GObject *object)
   XfceIndicatorButton *button = XFCE_INDICATOR_BUTTON (object);
 
   if (button-label != NULL)
-{
-  g_object_unref (G_OBJECT (button-label));
-  button-label = NULL;
-}
+g_object_unref (G_OBJECT (button-label));
   if (button-orig_icon != NULL)
-{
-  g_object_unref (G_OBJECT (button-orig_icon));
-  button-orig_icon = NULL;
-}
+g_object_unref (G_OBJECT (button-orig_icon));
   if (button-icon != NULL)
-{
-  g_object_unref (G_OBJECT (button-icon));
-  button-icon = NULL;
-}
-  if (button-io != NULL)
-{
-  g_object_unref (G_OBJECT (button-io));
-  button-io = NULL;
-}
-  if (button-entry != NULL)
-{
-  g_object_unref (G_OBJECT (button-entry));
-  button-entry = NULL;
-}
+g_object_unref (G_OBJECT (button-icon));
   if (button-menu != NULL)
-{
-  g_object_unref (G_OBJECT (button-menu));
-  button-menu = NULL;
-}
+g_object_unref (G_OBJECT (button-menu));
+  /* IndicatorObjectEntry is not GObject */
+  /* if (button-entry != NULL) */
+  /*   g_object_unref (G_OBJECT (button-entry)); */
+  if (button-io != NULL)
+g_object_unref (G_OBJECT (button-io));
 
   G_OBJECT_CLASS (xfce_indicator_button_parent_class)-finalize (object);
 }
@@ -442,10 +425,11 @@ xfce_indicator_button_new (IndicatorObject *io,
   XfceIndicatorButton *button = g_object_new (XFCE_TYPE_INDICATOR_BUTTON, 
NULL);
   button-io = io;
   button-entry = entry;
-  g_object_ref (G_OBJECT (button-io));
-  g_object_ref (G_OBJECT (button-entry));
+  if (button-io != NULL)
+g_object_ref (G_OBJECT (button-io));
+  /* IndicatorObjectEntry is not GObject */
+  /* g_object_ref (G_OBJECT (button-entry)); */
   return GTK_WIDGET (button);
 }
 
 
-
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-indicator-plugin:master Fixed panel 4.9 assert (widget not constructed)

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 57b1394a49142a979d77f089819f9c45f49320ab (commit)
   from d0bef06d946defc9fb2ae3682b1498092906713e (commit)

commit 57b1394a49142a979d77f089819f9c45f49320ab
Author: Andrzej ndrwr...@gmail.com
Date:   Sun Apr 8 23:59:25 2012 +0900

Fixed panel 4.9 assert (widget not constructed)

and some compilation warning fixes.

 panel-plugin/indicator.c |  130 +
 1 files changed, 61 insertions(+), 69 deletions(-)

diff --git a/panel-plugin/indicator.c b/panel-plugin/indicator.c
index 9d2bc52..aa986dc 100644
--- a/panel-plugin/indicator.c
+++ b/panel-plugin/indicator.c
@@ -175,74 +175,17 @@ static void
 indicator_init (IndicatorPlugin *indicator)
 {
   XfcePanelPlugin  *plugin = XFCE_PANEL_PLUGIN (indicator);
-  GtkRcStyle   *style;
-
-  /* setup transation domain */
-  xfce_textdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, UTF-8);
 
-  GtkOrientation  orientation;
-  gint indicators_loaded = 0;
-
-  /* get the current orientation */
-  orientation = xfce_panel_plugin_get_orientation (plugin);
-
-  /* Init some theme/icon stuff */
-  gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(),
-  INDICATOR_ICONS_DIR);
-  /*gtk_widget_set_name(GTK_WIDGET (indicator-plugin), indicator-plugin);*/
+  indicator-ebox = gtk_event_box_new();
+  gtk_widget_set_can_focus(GTK_WIDGET(indicator-ebox), TRUE);
 
   indicator-buttonbox = xfce_indicator_box_new ();
-
-  /* initialize xfconf */
-  if (xfconf_init(NULL)){
-/* get the list of excluded modules */
-indicator_read (indicator);
-  }
-  /* load 'em */
-  if (g_file_test(INDICATOR_DIR, (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) {
-GDir * dir = g_dir_open(INDICATOR_DIR, 0, NULL);
-
-const gchar * name;
-guint i, length;
-gboolean match = FALSE;
-
-length = (indicator-excluded_modules != NULL) ? g_strv_length 
(indicator-excluded_modules) : 0;
-while ((name = g_dir_read_name(dir)) != NULL) {
-  for (i = 0; i  length; ++i) {
-if (match = (g_strcmp0 (name, indicator-excluded_modules[i]) == 0))
-  break;
-  }
-
-  if (G_UNLIKELY (match)) {
-g_debug (Excluding module: %s, name);
-continue;
-  }
-
-  if (load_module(name, indicator))
-indicators_loaded++;
-}
-g_dir_close (dir);
-  }
-
-  if (indicators_loaded == 0) {
-/* A label to allow for click through */
-indicator-item = xfce_indicator_button_new(NULL, NULL);
-xfce_indicator_button_set_label(XFCE_INDICATOR_BUTTON(indicator-item),
-GTK_LABEL (gtk_label_new(_(No 
Indicators;
-gtk_container_add (GTK_CONTAINER (plugin), indicator-item);
-gtk_widget_show(indicator-item);
-/* show the panel's right-click menu on this menu */
-xfce_panel_plugin_add_action_widget (plugin, indicator-item);
-  } else {
-indicator-ebox = gtk_event_box_new();
-gtk_widget_set_can_focus(GTK_WIDGET(indicator-ebox), TRUE);
-gtk_container_add (GTK_CONTAINER (indicator-ebox), 
GTK_WIDGET(indicator-buttonbox));
-gtk_container_add (GTK_CONTAINER (plugin), GTK_WIDGET(indicator-ebox));
-gtk_widget_show(GTK_WIDGET(indicator-buttonbox));
-gtk_widget_show(GTK_WIDGET(indicator-ebox));
-/* show the panel's right-click menu on this menu */
-xfce_panel_plugin_add_action_widget (plugin, indicator-ebox);
-  }
+  gtk_container_add (GTK_CONTAINER (indicator-ebox), 
GTK_WIDGET(indicator-buttonbox));
+  gtk_container_add (GTK_CONTAINER (plugin), GTK_WIDGET(indicator-ebox));
+  gtk_widget_show(GTK_WIDGET(indicator-buttonbox));
+  gtk_widget_show(GTK_WIDGET(indicator-ebox));
+  /* show the panel's right-click menu on this menu */
+  xfce_panel_plugin_add_action_widget (plugin, indicator-ebox);
 }
 
 
@@ -357,11 +300,59 @@ menu_deactivate (GtkMenu *menu,
 static void
 indicator_construct (XfcePanelPlugin *plugin)
 {
-  IndicatorPlugin *indicator = XFCE_INDICATOR_PLUGIN (plugin);
+  IndicatorPlugin  *indicator = XFCE_INDICATOR_PLUGIN (plugin);
+  GtkRcStyle   *style;
+  gint  indicators_loaded = 0;
 
   xfce_panel_plugin_menu_show_configure (plugin);
 
-  //consider moving some stuff from indicator_init() here
+  /* setup transation domain */
+  xfce_textdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, UTF-8);
+
+  /* Init some theme/icon stuff */
+  gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(),
+  INDICATOR_ICONS_DIR);
+  /*gtk_widget_set_name(GTK_WIDGET (indicator-plugin), indicator-plugin);*/
+
+  /* initialize xfconf */
+  if (xfconf_init(NULL)){
+/* get the list of excluded modules */
+indicator_read (indicator);
+  }
+  /* load 'em */
+  if (g_file_test(INDICATOR_DIR, (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) {
+GDir * dir = g_dir_open(INDICATOR_DIR, 0, NULL);
+
+const gchar * name;
+guint i, length;
+gboolean match = FALSE;
+
+length = 

[Xfce4-commits] xfce4-indicator-plugin:master compilation error fix

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 8af1dffe564bf937c61ff0d3381a1d543b628e5b (commit)
   from fb8b0c8d6ca2337d7e4187685ee98dbe5e8420a0 (commit)

commit 8af1dffe564bf937c61ff0d3381a1d543b628e5b
Author: Andrzej ndrwr...@gmail.com
Date:   Sat Apr 28 01:25:19 2012 +0900

compilation error fix

 panel-plugin/indicator-button.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 51f82cc..364d137 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -57,7 +57,6 @@ xfce_indicator_button_init (XfceIndicatorButton *button)
   gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
   gtk_widget_set_name (GTK_WIDGET (button), indicator-button);
 
-  button-group = NULL;
   button-entry = NULL;
   button-menu = NULL;
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-indicator-plugin:master Added align-left property

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to fb8b0c8d6ca2337d7e4187685ee98dbe5e8420a0 (commit)
   from 57b1394a49142a979d77f089819f9c45f49320ab (commit)

commit fb8b0c8d6ca2337d7e4187685ee98dbe5e8420a0
Author: Andrzej ndrwr...@gmail.com
Date:   Fri Apr 27 20:41:59 2012 +0900

Added align-left property

It also improves handling of button alignment
(uses GtkAlignment instead of GtkArray).

 panel-plugin/indicator-box.c|   31 +++-
 panel-plugin/indicator-box.h|1 +
 panel-plugin/indicator-button.c |   68 +-
 panel-plugin/indicator-button.h |5 +++
 panel-plugin/indicator-dialog.c |6 +++
 panel-plugin/indicator-dialog.glade |   15 
 panel-plugin/indicator.c|3 ++
 7 files changed, 101 insertions(+), 28 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index 0643a3f..ffaf455 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -61,7 +61,8 @@ static gint xfce_indicator_box_get_row_size   
(XfceIndicatorBox
 enum
 {
   PROP_0,
-  PROP_ICON_SIZE_MAX
+  PROP_ICON_SIZE_MAX,
+  PROP_ALIGN_LEFT
 };
 
 G_DEFINE_TYPE (XfceIndicatorBox, xfce_indicator_box, GTK_TYPE_CONTAINER)
@@ -96,6 +97,13 @@ xfce_indicator_box_class_init (XfceIndicatorBoxClass *klass)
   128,
   24,
   EXO_PARAM_READWRITE));
+  g_object_class_install_property (gobject_class,
+   PROP_ALIGN_LEFT,
+   g_param_spec_boolean (align-left, NULL, 
NULL,
+ FALSE,
+ EXO_PARAM_READWRITE));
+
+
 }
 
 
@@ -112,6 +120,7 @@ xfce_indicator_box_init (XfceIndicatorBox *box)
 
   box-nrows = 1;
   box-icon_size_max = 24;
+  box-align_left = FALSE;
   box-panel_size = 16;
   box-panel_orientation = GTK_ORIENTATION_HORIZONTAL;
   box-orientation = GTK_ORIENTATION_HORIZONTAL;
@@ -150,6 +159,10 @@ xfce_indicator_box_get_property (GObject*object,
   g_value_set_uint (value, box-icon_size_max);
   break;
 
+case PROP_ALIGN_LEFT:
+  g_value_set_boolean (value, box-align_left);
+  break;
+
 default:
   G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
   break;
@@ -184,7 +197,20 @@ xfce_indicator_box_set_property (GObject  *object,
   g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (child));
   xfce_indicator_button_set_size (child, box-panel_size, size);
 }
-  gtk_widget_queue_resize (GTK_WIDGET (box));
+}
+  break;
+
+case PROP_ALIGN_LEFT:
+  val = g_value_get_boolean (value);
+  if (box-align_left != val)
+{
+  box-align_left = val;
+  for (li = box-children; li != NULL; li = li-next)
+{
+  child = XFCE_INDICATOR_BUTTON (li-data);
+  g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (child));
+  xfce_indicator_button_set_align_left (child, box-align_left);
+}
 }
   break;
 
@@ -299,6 +325,7 @@ xfce_indicator_box_add (GtkContainer *container,
   xfce_indicator_button_set_orientation (button, box-panel_orientation, 
box-orientation);
   size = xfce_indicator_box_get_row_size (box);
   xfce_indicator_button_set_size (button, box-panel_size, size);
+  xfce_indicator_button_set_align_left (button, box-align_left);
 
   gtk_widget_queue_resize (GTK_WIDGET (container));
 }
diff --git a/panel-plugin/indicator-box.h b/panel-plugin/indicator-box.h
index e302279..79b212d 100644
--- a/panel-plugin/indicator-box.h
+++ b/panel-plugin/indicator-box.h
@@ -46,6 +46,7 @@ struct _XfceIndicatorBox
   gint  panel_size;
   gint  nrows;
   gint  icon_size_max;
+  gboolean  align_left;
 
   GtkOrientationpanel_orientation;
   GtkOrientationorientation;
diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 58810ad..51f82cc 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -51,15 +51,13 @@ xfce_indicator_button_class_init (XfceIndicatorButtonClass 
*klass)
 static void
 xfce_indicator_button_init (XfceIndicatorButton *button)
 {
-  GtkWidget   *outer_container;
-
   GTK_WIDGET_UNSET_FLAGS (GTK_WIDGET (button), GTK_CAN_DEFAULT | 
GTK_CAN_FOCUS);
   gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
   gtk_button_set_use_underline (GTK_BUTTON (button),TRUE);
   gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
   gtk_widget_set_name (GTK_WIDGET (button), indicator-button);
 
-  button-io = NULL;
+  button-group = NULL;
   button-entry = NULL;
   button-menu = NULL;
 
@@ -71,17 +69,16 @@ xfce_indicator_button_init 

[Xfce4-commits] xfce4-indicator-plugin:master Moved button-related event handlers to buttons

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 2cb73e6d4175c5d693e91cc5357ac4564912e18f (commit)
   from c9785b9b7beb502e6b7bd03cbfbc6cd765040a29 (commit)

commit 2cb73e6d4175c5d693e91cc5357ac4564912e18f
Author: Andrzej ndrwr...@gmail.com
Date:   Sat Apr 28 19:03:13 2012 +0900

Moved button-related event handlers to buttons

 panel-plugin/indicator-box.c|   16 +-
 panel-plugin/indicator-box.h|5 +++
 panel-plugin/indicator-button.c |   65 ++-
 panel-plugin/indicator.c|   55 +
 panel-plugin/indicator.h|4 --
 5 files changed, 85 insertions(+), 60 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index 37248c4..78567b4 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -292,9 +292,14 @@ xfce_indicator_box_set_size (XfceIndicatorBox *box,
 
 
 GtkWidget *
-xfce_indicator_box_new ()
+xfce_indicator_box_new (XfcePanelPlugin *plugin)
 {
   XfceIndicatorBox *box = g_object_new (XFCE_TYPE_INDICATOR_BOX, NULL);
+
+  box-plugin = plugin;
+  if (box-plugin != NULL)
+g_object_ref (G_OBJECT (box-plugin));
+
   return GTK_WIDGET (box);
 }
 
@@ -633,3 +638,12 @@ xfce_indicator_box_get_align_left (XfceIndicatorBox *box)
 
   return box-align_left;
 }
+
+
+XfcePanelPlugin *
+xfce_indicator_box_get_plugin (XfceIndicatorBox *box)
+{
+  g_return_val_if_fail (XFCE_IS_INDICATOR_BOX (box), NULL);
+
+  return box-plugin;
+}
diff --git a/panel-plugin/indicator-box.h b/panel-plugin/indicator-box.h
index e4ee8c9..d0746c8 100644
--- a/panel-plugin/indicator-box.h
+++ b/panel-plugin/indicator-box.h
@@ -21,6 +21,7 @@
 #include glib.h
 #include gtk/gtk.h
 #include libindicator/indicator-object.h
+#include libxfce4panel/libxfce4panel.h
 
 G_BEGIN_DECLS
 
@@ -40,6 +41,8 @@ struct _XfceIndicatorBox
 {
   GtkContainer  __parent__;
 
+  XfcePanelPlugin  *plugin;
+
   GSList   *children;
 
   gint  panel_size;
@@ -82,6 +85,8 @@ gboolean xfce_indicator_box_get_align_left (XfceIndicatorBox 
*box);
 void xfce_indicator_box_remove_entry (XfceIndicatorBox *box,
   IndicatorObjectEntry *entry);
 
+XfcePanelPlugin *xfce_indicator_box_get_plugin (XfceIndicatorBox *box);
+
 GtkWidget *xfce_indicator_box_new ();
 
 G_END_DECLS
diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 58ff3cc..ac0f432 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -32,8 +32,21 @@
 
 #include indicator-button.h
 
+
+#include libindicator/indicator-object.h
+//#ifndef INDICATOR_OBJECT_SIGNAL_ENTRY_SCROLLED
+//#define INDICATOR_OBJECT_SIGNAL_ENTRY_SCROLLED scroll-entry
+//#endif
+
+
 static void xfce_indicator_button_finalize(GObject 
   *object);
 static gint xfce_indicator_button_get_icon_size   
(XfceIndicatorButton*button);
+static gboolean xfce_indicator_button_button_press(GtkWidget   
   *widget,
+   
GdkEventButton *event);
+static gboolean xfce_indicator_button_scroll  (GtkWidget   
   *widget,
+   
GdkEventScroll *event);
+static void xfce_indicator_button_menu_deactivate 
(XfceIndicatorButton*button,
+   GtkMenu 
   *menu);
 
 
 G_DEFINE_TYPE (XfceIndicatorButton, xfce_indicator_button, 
GTK_TYPE_TOGGLE_BUTTON)
@@ -41,10 +54,16 @@ G_DEFINE_TYPE (XfceIndicatorButton, xfce_indicator_button, 
GTK_TYPE_TOGGLE_BUTTO
 static void
 xfce_indicator_button_class_init (XfceIndicatorButtonClass *klass)
 {
-  GObjectClass   *gobject_class;
+  GObjectClass  *gobject_class;
+  GtkWidgetClass*widget_class;
 
   gobject_class = G_OBJECT_CLASS (klass);
   gobject_class-finalize = xfce_indicator_button_finalize;
+
+  widget_class = GTK_WIDGET_CLASS (klass);
+  widget_class-button_press_event = xfce_indicator_button_button_press;
+  widget_class-scroll_event = xfce_indicator_button_scroll;
+
 }
 
 
@@ -314,6 +333,8 @@ xfce_indicator_button_set_menu (XfceIndicatorButton *button,
 g_object_unref (G_OBJECT (button-menu));
   button-menu = menu;
   g_object_ref (G_OBJECT (button-menu));
+  g_signal_connect_swapped (G_OBJECT (button-menu), deactivate,
+G_CALLBACK 
(xfce_indicator_button_menu_deactivate), button);
   gtk_menu_attach_to_widget(menu, GTK_WIDGET (button), NULL);
 }
 }
@@ -454,3 +475,45 @@ xfce_indicator_button_disconnect_signals 
(XfceIndicatorButton *button)
 
 }
 
+
+static gboolean
+xfce_indicator_button_button_press (GtkWidget  *widget,
+GdkEventButton *event)
+{
+  XfceIndicatorButton *button = 

[Xfce4-commits] xfce4-indicator-plugin:master Fixed missing placeholder label (regression)

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to c40c282be0037c4de230fc7178c786a5fbab3689 (commit)
   from 2cb73e6d4175c5d693e91cc5357ac4564912e18f (commit)

commit c40c282be0037c4de230fc7178c786a5fbab3689
Author: Andrzej ndrwr...@gmail.com
Date:   Sun Apr 29 02:33:43 2012 +0900

Fixed missing placeholder label (regression)

also, use an ellipsis mode for labels in the deskbar mode.

 panel-plugin/indicator-button.c |   23 ---
 panel-plugin/indicator.c|   17 ++---
 2 files changed, 34 insertions(+), 6 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index ac0f432..97e26d3 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -131,30 +131,47 @@ static void
 xfce_indicator_button_update_layout (XfceIndicatorButton *button)
 {
   GtkRequisition  label_size;
+  gfloat  align_x;
 
   g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (button));
   g_return_if_fail (XFCE_IS_INDICATOR_BOX (button-buttonbox));
 
+  if (button-label != NULL)
+gtk_label_set_ellipsize (GTK_LABEL (button-label), PANGO_ELLIPSIZE_NONE);
+
+  /* deskbar mode? */
   if (button-label != NULL 
   xfce_indicator_box_get_panel_orientation (button-buttonbox) == 
GTK_ORIENTATION_VERTICAL 
   xfce_indicator_box_get_indicator_orientation (button-buttonbox) == 
GTK_ORIENTATION_HORIZONTAL)
 {
   gtk_widget_size_request (button-label, label_size);
 
+  /* check if icon and label fit side by side */
   if (!xfce_indicator_box_get_align_left (button-buttonbox)
   || (button-icon != NULL
label_size.width 
   xfce_indicator_box_get_panel_size (button-buttonbox)
   - xfce_indicator_box_get_indicator_size (button-buttonbox)))
 {
-  gtk_alignment_set (GTK_ALIGNMENT (button-align_box), 0.5, 0.5, 0.0, 
0.0);
+  align_x = 0.5;
   gtk_orientable_set_orientation (GTK_ORIENTABLE (button-box), 
GTK_ORIENTATION_VERTICAL);
 }
   else
 {
-  gtk_alignment_set (GTK_ALIGNMENT (button-align_box), 0.0, 0.5, 0.0, 
0.0);
+  align_x = 0.0;
   gtk_orientable_set_orientation (GTK_ORIENTABLE (button-box), 
GTK_ORIENTATION_HORIZONTAL);
 }
+
+  /* check if label alone fits in the panel */
+  if (label_size.width  xfce_indicator_box_get_panel_size 
(button-buttonbox) - 6)
+{
+  gtk_alignment_set (GTK_ALIGNMENT (button-align_box), align_x, 0.5, 
1.0, 0.0);
+  gtk_label_set_ellipsize (GTK_LABEL (button-label), 
PANGO_ELLIPSIZE_END);
+}
+  else
+{
+  gtk_alignment_set (GTK_ALIGNMENT (button-align_box), align_x, 0.5, 
0.0, 0.0);
+}
 }
   else
 {
@@ -482,7 +499,7 @@ xfce_indicator_button_button_press (GtkWidget  *widget,
 {
   XfceIndicatorButton *button = XFCE_INDICATOR_BUTTON (widget);
 
-  if( event-button == 1) /* left click only */
+  if(event-button == 1  button-menu != NULL) /* left click only */
 {
   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),TRUE);
   gtk_menu_popup (button-menu, NULL, NULL,
diff --git a/panel-plugin/indicator.c b/panel-plugin/indicator.c
index f152a02..88f4d42 100644
--- a/panel-plugin/indicator.c
+++ b/panel-plugin/indicator.c
@@ -276,6 +276,7 @@ indicator_construct (XfcePanelPlugin *plugin)
   IndicatorPlugin  *indicator = XFCE_INDICATOR_PLUGIN (plugin);
   GtkRcStyle   *style;
   gint  indicators_loaded = 0;
+  GtkWidget*label;
 
   xfce_panel_plugin_menu_show_configure (plugin);
 
@@ -321,10 +322,11 @@ indicator_construct (XfcePanelPlugin *plugin)
   if (indicators_loaded == 0) {
 /* A label to allow for click through */
 indicator-item = xfce_indicator_button_new(NULL, NULL, XFCE_INDICATOR_BOX 
(indicator-buttonbox));
-xfce_indicator_button_set_label(XFCE_INDICATOR_BUTTON(indicator-item),
-GTK_LABEL (gtk_label_new(_(No 
Indicators;
+label = gtk_label_new ( _(No Indicators));
+xfce_indicator_button_set_label (XFCE_INDICATOR_BUTTON (indicator-item), 
GTK_LABEL (label));
 gtk_container_add (GTK_CONTAINER (indicator-buttonbox), indicator-item);
-gtk_widget_show(indicator-item);
+gtk_widget_show (label);
+gtk_widget_show (indicator-item);
   }
 }
 
@@ -335,6 +337,15 @@ entry_added (IndicatorObject * io, IndicatorObjectEntry * 
entry, gpointer user_d
   XfcePanelPlugin *plugin = XFCE_PANEL_PLUGIN (user_data);
   IndicatorPlugin *indicator = XFCE_INDICATOR_PLUGIN (plugin);
   GtkWidget * button = xfce_indicator_button_new (io, entry, 
XFCE_INDICATOR_BOX (indicator-buttonbox));
+
+  /* remove placeholder item when there are real entries to be added */
+  if (indicator-item != NULL)
+{
+  xfce_indicator_button_disconnect_signals (XFCE_INDICATOR_BUTTON 
(indicator-item));
+  gtk_widget_destroy (GTK_WIDGET (indicator-item));
+  indicator-item = 

[Xfce4-commits] xfce4-indicator-plugin:master Refactored XfceIndicatorButton class

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to c9785b9b7beb502e6b7bd03cbfbc6cd765040a29 (commit)
   from 8af1dffe564bf937c61ff0d3381a1d543b628e5b (commit)

commit c9785b9b7beb502e6b7bd03cbfbc6cd765040a29
Author: Andrzej ndrwr...@gmail.com
Date:   Sat Apr 28 15:31:55 2012 +0900

Refactored XfceIndicatorButton class

Moved box-specific fields to XfceIndicatorBox and added
a box-layout-changed signal to update all buttons at once.
This may also be faster and less glitchy as signals
are merged by the main loop.

 panel-plugin/indicator-box.c|  141 +
 panel-plugin/indicator-box.h|   20 +++-
 panel-plugin/indicator-button.c |  222 ---
 panel-plugin/indicator-button.h |   29 ++
 panel-plugin/indicator.c|   11 +--
 5 files changed, 241 insertions(+), 182 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index ffaf455..37248c4 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -65,6 +65,15 @@ enum
   PROP_ALIGN_LEFT
 };
 
+enum
+{
+  BOX_LAYOUT_CHANGED,
+  LAST_SIGNAL
+};
+
+static guint xfce_indicator_box_signals[LAST_SIGNAL] = { 0, };
+
+
 G_DEFINE_TYPE (XfceIndicatorBox, xfce_indicator_box, GTK_TYPE_CONTAINER)
 
 static void
@@ -103,7 +112,13 @@ xfce_indicator_box_class_init (XfceIndicatorBoxClass 
*klass)
  FALSE,
  EXO_PARAM_READWRITE));
 
-
+  xfce_indicator_box_signals[BOX_LAYOUT_CHANGED] =
+g_signal_new (g_intern_static_string (box-layout-changed),
+  G_TYPE_FROM_CLASS (gobject_class),
+  G_SIGNAL_RUN_LAST,
+  0, NULL, NULL,
+  g_cclosure_marshal_VOID__VOID,
+  G_TYPE_NONE, 0);
 }
 
 
@@ -190,13 +205,7 @@ xfce_indicator_box_set_property (GObject  *object,
   if (box-icon_size_max != val)
 {
   box-icon_size_max = val;
-  size = xfce_indicator_box_get_row_size (box);
-  for (li = box-children; li != NULL; li = li-next)
-{
-  child = XFCE_INDICATOR_BUTTON (li-data);
-  g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (child));
-  xfce_indicator_button_set_size (child, box-panel_size, size);
-}
+  g_signal_emit (G_OBJECT (box), 
xfce_indicator_box_signals[BOX_LAYOUT_CHANGED], 0);
 }
   break;
 
@@ -205,12 +214,7 @@ xfce_indicator_box_set_property (GObject  *object,
   if (box-align_left != val)
 {
   box-align_left = val;
-  for (li = box-children; li != NULL; li = li-next)
-{
-  child = XFCE_INDICATOR_BUTTON (li-data);
-  g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (child));
-  xfce_indicator_button_set_align_left (child, box-align_left);
-}
+  g_signal_emit (G_OBJECT (box), 
xfce_indicator_box_signals[BOX_LAYOUT_CHANGED], 0);
 }
   break;
 
@@ -247,12 +251,7 @@ xfce_indicator_box_set_orientation (XfceIndicatorBox *box,
 
   if (needs_update)
 {
-  for (li = box-children; li != NULL; li = li-next)
-{
-  child = XFCE_INDICATOR_BUTTON (li-data);
-  g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (child));
-  xfce_indicator_button_set_orientation (child, panel_orientation, 
orientation);
-}
+  g_signal_emit (G_OBJECT (box), 
xfce_indicator_box_signals[BOX_LAYOUT_CHANGED], 0);
   gtk_widget_queue_resize (GTK_WIDGET (box));
 }
 }
@@ -285,13 +284,7 @@ xfce_indicator_box_set_size (XfceIndicatorBox *box,
 
   if (needs_update)
 {
-  size = xfce_indicator_box_get_row_size (box);
-  for (li = box-children; li != NULL; li = li-next)
-{
-  child = XFCE_INDICATOR_BUTTON (li-data);
-  g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (child));
-  xfce_indicator_button_set_size (child, panel_size, size);
-}
+  g_signal_emit (G_OBJECT (box), 
xfce_indicator_box_signals[BOX_LAYOUT_CHANGED], 0);
   gtk_widget_queue_resize (GTK_WIDGET (box));
 }
 }
@@ -322,10 +315,6 @@ xfce_indicator_box_add (GtkContainer *container,
   box-children = g_slist_append (box-children, child);
 
   gtk_widget_set_parent (child, GTK_WIDGET (box));
-  xfce_indicator_button_set_orientation (button, box-panel_orientation, 
box-orientation);
-  size = xfce_indicator_box_get_row_size (box);
-  xfce_indicator_button_set_size (button, box-panel_size, size);
-  xfce_indicator_button_set_align_left (button, box-align_left);
 
   gtk_widget_queue_resize (GTK_WIDGET (container));
 }
@@ -402,9 +391,7 @@ xfce_indicator_box_size_request (GtkWidget  *widget,
   row = 0;
   length = 0;
   x = 0;
-  //nrows = MAX (box-nrows,
-  // box-panel_size / xfce_indicator_box_get_row_size (box));
-  nrows = box-panel_size / xfce_indicator_box_get_row_size (box);
+  

[Xfce4-commits] xfce4-indicator-plugin:master Make sure the menu is closed when the button is removed.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to aaa1b5f89857605cfbc512f17623d2c66e1f1512 (commit)
   from 24788ad2952d8afc4e2135d176bd62a7755a3d87 (commit)

commit aaa1b5f89857605cfbc512f17623d2c66e1f1512
Author: Andrzej ndrwr...@gmail.com
Date:   Wed Jul 25 17:35:50 2012 +0900

Make sure the menu is closed when the button is removed.

 panel-plugin/indicator-button.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index ef8fa56..8c2aaa7 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -474,6 +474,11 @@ xfce_indicator_button_disconnect_signals 
(XfceIndicatorButton *button)
 {
   g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (button));
 
+  if (button-menu != 0)
+{
+  gtk_menu_popdown (button-menu);
+}
+
   if (button-box_layout_changed_id != 0)
 {
   g_signal_handler_disconnect (button-buttonbox, 
button-box_layout_changed_id);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-indicator-plugin:master Worked around crashes when plugin is loaded as an external plugin.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 707ad099934c2e3ff7aab18c0601b6072e23f782 (commit)
   from 00633e1de8308a1456a46f8dc03f7baa2a62c30a (commit)

commit 707ad099934c2e3ff7aab18c0601b6072e23f782
Author: Andrzej ndrwr...@gmail.com
Date:   Sun Dec 2 21:34:37 2012 +

Worked around crashes when plugin is loaded as an external plugin.

The plugin used to crash when xfce4-panel was compiled with
--enable-debug and the plugin was configured as an external module
(X-XFCE-Internal=FALSE in indicator.desktop file).

This was caused by the wrapper binary setting a more restrictive
fatal mask than the xfce4-panel binary. As we are linking external
code (indicators) we have no control over their use of g_warning or
g_critical.

This commit relaxes the fatal mask so that the use of g_warning or
g_critical does not crash the plugin.

 panel-plugin/indicator.c |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/indicator.c b/panel-plugin/indicator.c
index e807328..47c5e1b 100644
--- a/panel-plugin/indicator.c
+++ b/panel-plugin/indicator.c
@@ -178,6 +178,12 @@ indicator_init (IndicatorPlugin *indicator)
 {
   XfcePanelPlugin  *plugin = XFCE_PANEL_PLUGIN (indicator);
 
+  /* Indicators print a lot of warnings. By default, wrapper
+ makes them critical, so the plugin crashes when run as an external
+ plugin but not internal one (loaded by xfce4-panel itself).
+ The following lines makes only g_error critical. */
+  g_log_set_always_fatal (G_LOG_LEVEL_ERROR);
+
   indicator-buttonbox = xfce_indicator_box_new (plugin);
   gtk_container_add (GTK_CONTAINER (plugin), GTK_WIDGET(indicator-buttonbox));
   gtk_widget_show(GTK_WIDGET(indicator-buttonbox));
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-indicator-plugin:master Plugged a memory leak.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 94c371f5760b00df1cbba141a12c3192aa339e2b (commit)
   from 1c76403a300e778ca5e170acbbf3f01dde9c8c18 (commit)

commit 94c371f5760b00df1cbba141a12c3192aa339e2b
Author: Andrzej ndrwr...@gmail.com
Date:   Tue Dec 25 23:56:10 2012 +

Plugged a memory leak.

 panel-plugin/indicator-button.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 109544f..74f7d28 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -228,6 +228,7 @@ xfce_indicator_button_update_icon (XfceIndicatorButton 
*button)
   (pixbuf_s, (gint) (size * aspect), size,
GDK_INTERP_BILINEAR);
   xfce_panel_image_set_from_pixbuf (XFCE_PANEL_IMAGE (button-icon), 
pixbuf_d);
+  g_object_unref (G_OBJECT (pixbuf_d));
 }
   else
 {
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-indicator-plugin:master Removed unneeded event box causing issues with transparent panels.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 00633e1de8308a1456a46f8dc03f7baa2a62c30a (commit)
   from aaa1b5f89857605cfbc512f17623d2c66e1f1512 (commit)

commit 00633e1de8308a1456a46f8dc03f7baa2a62c30a
Author: Andrzej ndrwr...@gmail.com
Date:   Sat Nov 17 21:39:39 2012 +

Removed unneeded event box causing issues with transparent panels.

For unknown reasons indicator plugin was handling transparency
correctly when run as an executable but not when run as a module.

 panel-plugin/indicator.c |   10 +-
 1 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/panel-plugin/indicator.c b/panel-plugin/indicator.c
index 09aab6a..e807328 100644
--- a/panel-plugin/indicator.c
+++ b/panel-plugin/indicator.c
@@ -80,7 +80,6 @@ struct _IndicatorPlugin
   /* panel widgets */
   GtkWidget   *item;
   GtkWidget   *buttonbox;
-  GtkWidget   *ebox;
 
   /* indicator settings */
   gchar  **excluded_modules;
@@ -179,16 +178,9 @@ indicator_init (IndicatorPlugin *indicator)
 {
   XfcePanelPlugin  *plugin = XFCE_PANEL_PLUGIN (indicator);
 
-  indicator-ebox = gtk_event_box_new();
-  gtk_widget_set_can_focus(GTK_WIDGET(indicator-ebox), TRUE);
-
   indicator-buttonbox = xfce_indicator_box_new (plugin);
-  gtk_container_add (GTK_CONTAINER (indicator-ebox), 
GTK_WIDGET(indicator-buttonbox));
-  gtk_container_add (GTK_CONTAINER (plugin), GTK_WIDGET(indicator-ebox));
+  gtk_container_add (GTK_CONTAINER (plugin), GTK_WIDGET(indicator-buttonbox));
   gtk_widget_show(GTK_WIDGET(indicator-buttonbox));
-  gtk_widget_show(GTK_WIDGET(indicator-ebox));
-  /* show the panel's right-click menu on this menu */
-  xfce_panel_plugin_add_action_widget (plugin, indicator-ebox);
 }
 
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-indicator-plugin:master Fixed compilation warnings

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 24788ad2952d8afc4e2135d176bd62a7755a3d87 (commit)
   from c40c282be0037c4de230fc7178c786a5fbab3689 (commit)

commit 24788ad2952d8afc4e2135d176bd62a7755a3d87
Author: Andrzej ndrwr...@gmail.com
Date:   Thu May 10 23:47:10 2012 +0900

Fixed compilation warnings

The remaining ones:
/usr/local/include/libindicator-0.4/libindicator/indicator-object.h:190:13: 
warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
come from libindicator headers.

 panel-plugin/indicator-box.c|   11 
 panel-plugin/indicator-button.c |4 ---
 panel-plugin/indicator.c|   55 +-
 3 files changed, 30 insertions(+), 40 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index 78567b4..854f4a4 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -166,7 +166,6 @@ xfce_indicator_box_get_property (GObject*object,
  GParamSpec *pspec)
 {
   XfceIndicatorBox *box = XFCE_INDICATOR_BOX (object);
-  GPtrArray*array;
 
   switch (prop_id)
 {
@@ -194,9 +193,6 @@ xfce_indicator_box_set_property (GObject  *object,
 {
   XfceIndicatorBox *box = XFCE_INDICATOR_BOX (object);
   gint  val;
-  gint  size;
-  XfceIndicatorButton  *child;
-  GSList   *li;
 
   switch (prop_id)
 {
@@ -232,8 +228,6 @@ xfce_indicator_box_set_orientation (XfceIndicatorBox *box,
 GtkOrientationorientation)
 {
   gboolean  needs_update = FALSE;
-  XfceIndicatorButton  *child;
-  GSList   *li;
 
   g_return_if_fail (XFCE_IS_INDICATOR_BOX (box));
 
@@ -264,9 +258,6 @@ xfce_indicator_box_set_size (XfceIndicatorBox *box,
  gint  nrows)
 {
   gboolean  needs_update = FALSE;
-  XfceIndicatorButton  *child;
-  GSList   *li;
-  gint  size;
 
   g_return_if_fail (XFCE_IS_INDICATOR_BOX (box));
 
@@ -310,8 +301,6 @@ xfce_indicator_box_add (GtkContainer *container,
 GtkWidget*child)
 {
   XfceIndicatorBox*box = XFCE_INDICATOR_BOX (container);
-  XfceIndicatorButton *button = XFCE_INDICATOR_BUTTON (child);
-  gint size;
 
   g_return_if_fail (XFCE_IS_INDICATOR_BOX (box));
   g_return_if_fail (GTK_IS_WIDGET (child));
diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 97e26d3..ef8fa56 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -278,8 +278,6 @@ xfce_indicator_button_set_label (XfceIndicatorButton 
*button,
 static void
 on_pixbuf_changed (GtkImage *image, GParamSpec *pspec, XfceIndicatorButton 
*button)
 {
-  GdkPixbuf *pixbuf;
-
   g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (button));
   g_return_if_fail (GTK_IS_IMAGE (image));
   g_return_if_fail (XFCE_IS_PANEL_IMAGE (button-icon));
@@ -293,8 +291,6 @@ void
 xfce_indicator_button_set_image (XfceIndicatorButton *button,
  GtkImage*image)
 {
-  GdkPixbuf *pixbuf;
-
   g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (button));
   g_return_if_fail (GTK_IS_IMAGE (image));
 
diff --git a/panel-plugin/indicator.c b/panel-plugin/indicator.c
index 88f4d42..09aab6a 100644
--- a/panel-plugin/indicator.c
+++ b/panel-plugin/indicator.c
@@ -154,9 +154,9 @@ static void
 indicator_class_init (IndicatorPluginClass *klass)
 {
   XfcePanelPluginClass *plugin_class;
-  GObjectClass *gobject_class;
+  //GObjectClass *gobject_class;
 
-  gobject_class = G_OBJECT_CLASS (klass);
+  //gobject_class = G_OBJECT_CLASS (klass);
   //gobject_class-get_property = indicator_get_property;
   //gobject_class-set_property = indicator_set_property;
 
@@ -196,7 +196,7 @@ indicator_init (IndicatorPlugin *indicator)
 static void
 indicator_free (XfcePanelPlugin *plugin)
 {
-  IndicatorPlugin *indicator = XFCE_INDICATOR_PLUGIN (plugin);
+  //IndicatorPlugin *indicator = XFCE_INDICATOR_PLUGIN (plugin);
   GtkWidget *dialog;
 
   /* check if the dialog is still open. if so, destroy it */
@@ -274,7 +274,6 @@ static void
 indicator_construct (XfcePanelPlugin *plugin)
 {
   IndicatorPlugin  *indicator = XFCE_INDICATOR_PLUGIN (plugin);
-  GtkRcStyle   *style;
   gint  indicators_loaded = 0;
   GtkWidget*label;
 
@@ -304,7 +303,7 @@ indicator_construct (XfcePanelPlugin *plugin)
 length = (indicator-excluded_modules != NULL) ? g_strv_length 
(indicator-excluded_modules) : 0;
 while ((name = g_dir_read_name(dir)) != NULL) {
   for (i = 0; i  length; ++i) {
-if (match = (g_strcmp0 (name, indicator-excluded_modules[i]) == 0))
+if ((match = g_strcmp0 (name, indicator-excluded_modules[i])) == 0)
   break;
   }
 
@@ -374,34 +373,40 @@ entry_removed (IndicatorObject * io, IndicatorObjectEntry 

[Xfce4-commits] xfce4-indicator-plugin:master Fixed menu positioning.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 1c76403a300e778ca5e170acbbf3f01dde9c8c18 (commit)
   from 707ad099934c2e3ff7aab18c0601b6072e23f782 (commit)

commit 1c76403a300e778ca5e170acbbf3f01dde9c8c18
Author: Andrzej ndrwr...@gmail.com
Date:   Sun Dec 9 02:46:58 2012 +

Fixed menu positioning.

Occasionally, e.g. when indicator was placed near the bottom
of a vertical panel, the first click on a button resulted
in an incorrect position/size of the menu. Subsequent clicks
were fixing this behavior.

This commit repositions the menu to reset its position and size.

 panel-plugin/indicator-button.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 8c2aaa7..109544f 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -503,6 +503,7 @@ xfce_indicator_button_button_press (GtkWidget  *widget,
   if(event-button == 1  button-menu != NULL) /* left click only */
 {
   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),TRUE);
+  gtk_menu_reposition (GTK_MENU (button-menu));
   gtk_menu_popup (button-menu, NULL, NULL,
   xfce_panel_plugin_position_menu,
   xfce_indicator_box_get_plugin (button-buttonbox),
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-indicator-plugin:master Added support for indicator reordering.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 0db001bdd6e764e2e375ac69ad01418c09c3b6da (commit)
   from 86c62c471dcaf3f2a9b84a501e9e49d2ffc1152e (commit)

commit 0db001bdd6e764e2e375ac69ad01418c09c3b6da
Author: Andrzej ndrwr...@gmail.com
Date:   Tue Mar 12 02:08:51 2013 +

Added support for indicator reordering.

Fairly extensive changes to the indicator container class.
Needs testing with more complex indicators (globalmenu etc).

 panel-plugin/indicator-box.c|  318 +++
 panel-plugin/indicator-button.c |   13 ++
 panel-plugin/indicator-button.h |   28 ++--
 panel-plugin/indicator.c|   12 +-
 4 files changed, 227 insertions(+), 144 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index 2766bc1..a48f22b 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -34,6 +34,8 @@
 #include indicator-button.h
 
 static void xfce_indicator_box_finalize   (GObject 
 *object);
+static void xfce_indicator_box_list_changed   
(XfceIndicatorBox *box,
+   IndicatorConfig 
 *config);
 static void xfce_indicator_box_add(GtkContainer
 *container,
GtkWidget   
 *child);
 static void xfce_indicator_box_remove (GtkContainer
 *container,
@@ -55,7 +57,7 @@ struct _XfceIndicatorBox
 
   IndicatorConfig  *config;
 
-  GSList   *children;
+  GHashTable   *children;
 
   gint  panel_size;
   gint  nrows;
@@ -64,6 +66,8 @@ struct _XfceIndicatorBox
 
   GtkOrientationpanel_orientation;
   GtkOrientationorientation;
+
+  gulongindicator_list_changed_id;
 };
 
 struct _XfceIndicatorBoxClass
@@ -107,7 +111,12 @@ xfce_indicator_box_init (XfceIndicatorBox *box)
   gtk_widget_set_can_focus(GTK_WIDGET(box), TRUE);
   gtk_container_set_border_width(GTK_CONTAINER(box), 0);
 
-  box-children = NULL;
+  /* todo: no deallocation function for values */
+  box-children = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, 
NULL);
+
+  box-indicator_list_changed_id =
+g_signal_connect_swapped (G_OBJECT (box-config), indicator-list-changed,
+  G_CALLBACK (xfce_indicator_box_list_changed), 
box);
 }
 
 
@@ -117,12 +126,14 @@ xfce_indicator_box_finalize (GObject *object)
 {
   XfceIndicatorBox *box = XFCE_INDICATOR_BOX (object);
 
-  if (box-children != NULL)
+  if (box-indicator_list_changed_id != 0)
 {
-  g_slist_free (box-children);
-  g_debug (Not all icons have been removed from the indicator icon box.);
+  g_signal_handler_disconnect (box-config, 
box-indicator_list_changed_id);
+  box-indicator_list_changed_id = 0;
 }
 
+  g_hash_table_destroy (box-children);
+
   G_OBJECT_CLASS (xfce_indicator_box_parent_class)-finalize (object);
 }
 
@@ -141,16 +152,34 @@ xfce_indicator_box_new (IndicatorConfig *config)
 
 
 static void
+xfce_indicator_box_list_changed (XfceIndicatorBox *box,
+ IndicatorConfig  *config)
+{
+  g_return_if_fail (XFCE_IS_INDICATOR_BOX (box));
+  g_return_if_fail (XFCE_IS_INDICATOR_CONFIG (config));
+
+  gtk_widget_queue_resize (GTK_WIDGET (box));
+}
+
+
+
+static void
 xfce_indicator_box_add (GtkContainer *container,
 GtkWidget*child)
 {
   XfceIndicatorBox*box = XFCE_INDICATOR_BOX (container);
+  XfceIndicatorButton *button = XFCE_INDICATOR_BUTTON (child);
+  GList   *li;
+  const gchar *io_name;
 
   g_return_if_fail (XFCE_IS_INDICATOR_BOX (box));
-  g_return_if_fail (GTK_IS_WIDGET (child));
+  g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (button));
   g_return_if_fail (child-parent == NULL);
 
-  box-children = g_slist_append (box-children, child);
+  io_name = xfce_indicator_button_get_io_name (button);
+  li = g_hash_table_lookup (box-children, io_name);
+  li = g_list_append (li, button);
+  g_hash_table_replace (box-children, g_strdup (io_name), li);
 
   gtk_widget_set_parent (child, GTK_WIDGET (box));
 
@@ -163,17 +192,22 @@ static void
 xfce_indicator_box_remove (GtkContainer *container,
GtkWidget*child)
 {
-  XfceIndicatorBox *box = XFCE_INDICATOR_BOX (container);
-  GSList   *li;
+  XfceIndicatorBox*box = XFCE_INDICATOR_BOX (container);
+  XfceIndicatorButton *button = XFCE_INDICATOR_BUTTON (child);
+  GList   *li, *li_tmp;
+  const gchar *io_name;
 
   /* search the child */
-  li = g_slist_find (box-children, child);
-  if (G_LIKELY (li != NULL))
+  io_name = xfce_indicator_button_get_io_name (button);
+  li = g_hash_table_lookup (box-children, io_name);
+  li_tmp = g_list_find (li, child);
+  if (G_LIKELY (li_tmp != NULL))
 {
-  g_assert (GTK_WIDGET (li-data) 

[Xfce4-commits] xfce4-indicator-plugin:master Sort indicator entries by location.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 33d3eb312c04fb7ae12e2a316e52a838267e5e0a (commit)
   from 290c5f4596900e67f3c2e87f730812e8e48a9333 (commit)

commit 33d3eb312c04fb7ae12e2a316e52a838267e5e0a
Author: Andrzej ndrwr...@gmail.com
Date:   Tue Mar 12 22:53:25 2013 +

Sort indicator entries by location.

(or by name_hint, or don't sort at all)

 panel-plugin/indicator-box.c|   32 +++-
 panel-plugin/indicator-button.c |   14 ++
 panel-plugin/indicator-button.h |2 ++
 3 files changed, 47 insertions(+), 1 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index 3b820a9..c39435e 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -163,6 +163,32 @@ xfce_indicator_box_list_changed (XfceIndicatorBox *box,
 
 
 
+static gint
+xfce_indicator_box_sort_buttons (gconstpointer a,
+ gconstpointer b)
+{
+  XfceIndicatorButton *a0 = XFCE_INDICATOR_BUTTON (a);
+  XfceIndicatorButton *b0 = XFCE_INDICATOR_BUTTON (b);
+  guinta1, b1;
+
+  a1 = xfce_indicator_button_get_pos (a0);
+  b1 = xfce_indicator_button_get_pos (b0);
+
+  /* group all entries with location==0 at the beginning of the list
+   * but don't sort them (they may depend on insertion order) */
+
+  /* if there are two entries with the same non-zero location
+   * try to resolve their order by their name_hint */
+  if (a1 != 0  a1 == b1)
+return -g_strcmp0 (xfce_indicator_button_get_entry(a0)-name_hint,
+   xfce_indicator_button_get_entry(b0)-name_hint);
+
+  /* else, use the location field */
+  return (a1-b1);
+}
+
+
+
 static void
 xfce_indicator_box_add (GtkContainer *container,
 GtkWidget*child)
@@ -178,7 +204,11 @@ xfce_indicator_box_add (GtkContainer *container,
 
   io_name = xfce_indicator_button_get_io_name (button);
   li = g_hash_table_lookup (box-children, io_name);
-  li = g_list_append (li, button);
+  if (xfce_indicator_button_get_pos (button) == 0)
+li = g_list_append (li, button);
+  else
+li = g_list_insert_sorted (li, button, xfce_indicator_box_sort_buttons);
+
   g_hash_table_replace (box-children, g_strdup (io_name), li);
 
   gtk_widget_set_parent (child, GTK_WIDGET (box));
diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index f01db2f..98f547d 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -434,6 +434,20 @@ xfce_indicator_button_get_io_name (XfceIndicatorButton 
*button)
 
 
 
+guint
+xfce_indicator_button_get_pos (XfceIndicatorButton *button)
+{
+  g_return_val_if_fail (XFCE_IS_INDICATOR_BUTTON (button), 0);
+
+  return indicator_object_get_location (button-io, button-entry);
+}
+
+
+
+
+
+
+
 GtkMenu *
 xfce_indicator_button_get_menu (XfceIndicatorButton *button)
 {
diff --git a/panel-plugin/indicator-button.h b/panel-plugin/indicator-button.h
index 5eb1dc1..b25efa6 100644
--- a/panel-plugin/indicator-button.h
+++ b/panel-plugin/indicator-button.h
@@ -59,6 +59,8 @@ IndicatorObject*xfce_indicator_button_get_io  
(XfceIndicatorButton
 
 const gchar*xfce_indicator_button_get_io_name (XfceIndicatorButton 
   *button);
 
+guint   xfce_indicator_button_get_pos (XfceIndicatorButton 
   *button);
+
 GtkMenu*xfce_indicator_button_get_menu(XfceIndicatorButton 
   *button);
 
 GtkWidget  *xfce_indicator_button_new (IndicatorObject 
   *io,
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-indicator-plugin:master Fixed a regression, inconsistent border sizes.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 8eb305349bff65313d8300defa8918675cc38bf6 (commit)
   from 81c78516eec9103da0ba00c79ab2d936a91b6c99 (commit)

commit 8eb305349bff65313d8300defa8918675cc38bf6
Author: Andrzej ndrwr...@gmail.com
Date:   Thu Mar 14 01:22:35 2013 +

Fixed a regression, inconsistent border sizes.

Not sure why different buttons had different x/ythickness values.
Fixed that by checking container's style. Also, reduced the border
size by 2px.

 panel-plugin/indicator-button.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 98f547d..0508674 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -469,8 +469,8 @@ xfce_indicator_button_get_icon_size (XfceIndicatorButton 
*button)
 
   indicator_size = xfce_indicator_button_get_size (button);
 
-  style = gtk_widget_get_style (GTK_WIDGET (button));
-  border_thickness = 2 * MAX (style-xthickness, style-ythickness) + 2;
+  style = gtk_widget_get_style (GTK_WIDGET (button-plugin));
+  border_thickness = 2 * MAX (style-xthickness, style-ythickness);
 
   return MIN (indicator_size - border_thickness,
   indicator_config_get_icon_size_max (button-config));
@@ -486,8 +486,8 @@ xfce_indicator_button_get_size (XfceIndicatorButton *button)
 
   g_return_val_if_fail (XFCE_IS_INDICATOR_BUTTON (button), 24);
 
-  style = gtk_widget_get_style (GTK_WIDGET (button));
-  border_thickness = 2 * MAX (style-xthickness, style-ythickness) + 2;
+  style = gtk_widget_get_style (GTK_WIDGET (button-plugin));
+  border_thickness = 2 * MAX (style-xthickness, style-ythickness) ;
 
   return MIN (indicator_config_get_panel_size (button-config) /
   indicator_config_get_nrows (button-config),
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-indicator-plugin:master Added pretty names and indicators for known indicators.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to b552265a8ed94468d24f6eeb387a2a7b762cc94c (commit)
   from 33d3eb312c04fb7ae12e2a316e52a838267e5e0a (commit)

commit b552265a8ed94468d24f6eeb387a2a7b762cc94c
Author: Andrzej ndrwr...@gmail.com
Date:   Wed Mar 13 00:15:05 2013 +

Added pretty names and indicators for known indicators.

I've used listed indicators available in Ubuntu (12.10) repository.
The names are unofficial and icons are picked from my own system.
Please feel free to update/fix them.

 panel-plugin/indicator-dialog.c |   95 +++---
 panel-plugin/indicator-dialog.glade |   21 +++-
 2 files changed, 95 insertions(+), 21 deletions(-)

diff --git a/panel-plugin/indicator-dialog.c b/panel-plugin/indicator-dialog.c
index 1387c76..d4740fe 100644
--- a/panel-plugin/indicator-dialog.c
+++ b/panel-plugin/indicator-dialog.c
@@ -43,6 +43,23 @@
 
 
 
+/* known indicator names */
+static const gchar *pretty_names[][3] =
+{
+  /* raw name,  pretty name, 
icon-name(?) */
+  { libapplication.so,N_(Application Indicators),   
application-default-icon },
+  { libsoundmenu.so,  N_(Sound Menu),   
preferences-desktop-sound },
+  { libprintersmenu.so,   N_(Printers Menu),
printer },
+  { libpower.so,  N_(Power Management), 
NULL },
+  { libappmenu.so,N_(Application Menus (Global Menu)),  
menu-editor },
+  { libsession.so,N_(Session Management),   
NULL },
+  { libmessaging.so,  N_(Messaging Menu),   
indicator-messages },
+  { libdatetime.so,   N_(Date and Time),
time-admin },
+};
+
+
+#define ICON_SIZE (22)
+
 static void  indicator_dialog_build   (IndicatorDialog 
 *dialog);
 static void  indicator_dialog_response(GtkWidget   
 *window,
gint
  response_id,
@@ -71,7 +88,8 @@ enum
   COLUMN_PIXBUF,
   COLUMN_TITLE,
   COLUMN_HIDDEN,
-  COLUMN_VISIBLE
+  COLUMN_VISIBLE,
+  COLUMN_TIP
 };
 
 
@@ -102,6 +120,7 @@ static void
 indicator_dialog_add_indicator (IndicatorDialog *dialog,
 GdkPixbuf   *pixbuf,
 const gchar *name,
+const gchar *pretty_name,
 gboolean hidden,
 gboolean visible)
 {
@@ -114,10 +133,11 @@ indicator_dialog_add_indicator (IndicatorDialog *dialog,
   /* insert in the store */
   gtk_list_store_append (GTK_LIST_STORE (dialog-store), iter);
   gtk_list_store_set (GTK_LIST_STORE (dialog-store), iter,
-  COLUMN_PIXBUF, pixbuf,
-  COLUMN_TITLE, name,
-  COLUMN_HIDDEN, hidden,
+  COLUMN_PIXBUF,  pixbuf,
+  COLUMN_TITLE,   (pretty_name != NULL) ? pretty_name : 
name,
+  COLUMN_HIDDEN,  hidden,
   COLUMN_VISIBLE, visible,
+  COLUMN_TIP, name,
   -1);
 }
 
@@ -128,6 +148,10 @@ indicator_dialog_update_indicator_names (IndicatorDialog 
*dialog)
 {
   GList*li;
   const gchar  *name;
+  const gchar  *pretty_name = NULL;
+  const gchar  *icon_name = NULL;
+  GdkPixbuf*pixbuf = NULL;
+  guint i;
 
   g_return_if_fail (XFCE_IS_INDICATOR_DIALOG (dialog));
   g_return_if_fail (XFCE_IS_INDICATOR_CONFIG (dialog-config));
@@ -136,13 +160,35 @@ indicator_dialog_update_indicator_names (IndicatorDialog 
*dialog)
   for(li = indicator_config_get_known_indicators (dialog-config); li != NULL; 
li = li-next)
 {
   name = li-data;
+
+  /* check if we have a better name for the application */
+  for (i = 0; i  G_N_ELEMENTS (pretty_names); i++)
+{
+  if (strcmp (name, pretty_names[i][0]) == 0)
+{
+  pretty_name = pretty_names[i][1];
+  icon_name = pretty_names[i][2];
+  break;
+}
+}
+
+  /* try to load the icon name */
+  if (icon_name != NULL)
+pixbuf = xfce_panel_pixbuf_from_source (icon_name, NULL, ICON_SIZE);
+  else
+pixbuf = NULL;
+
+  /* insert indicator in the store */
   indicator_dialog_add_indicator
 (dialog,
- NULL,
+ pixbuf,
  name,
+ pretty_name,
  indicator_config_is_blacklisted (dialog-config, name),
  indicator_config_is_whitelisted (dialog-config, name));
 }
+  if (pixbuf != NULL)
+g_object_unref (G_OBJECT (pixbuf));
 }
 
 
@@ -164,14 +210,14 @@ indicator_dialog_hidden_toggled (GtkCellRendererToggle 
*renderer,
 {
   gtk_tree_model_get 

[Xfce4-commits] xfce4-indicator-plugin:master Force a configuration-changed signal at start-up.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 81c78516eec9103da0ba00c79ab2d936a91b6c99 (commit)
   from 346cfe1ab16173fc0c5fe13a23c144a94f99239e (commit)

commit 81c78516eec9103da0ba00c79ab2d936a91b6c99
Author: Andrzej ndrwr...@gmail.com
Date:   Thu Mar 14 00:44:46 2013 +

Force a configuration-changed signal at start-up.

 panel-plugin/indicator-config.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/indicator-config.c b/panel-plugin/indicator-config.c
index 09dbb96..c4bcf16 100644
--- a/panel-plugin/indicator-config.c
+++ b/panel-plugin/indicator-config.c
@@ -773,6 +773,8 @@ indicator_config_new (const gchar *property_base)
   property = g_strconcat (property_base, /known-indicators, NULL);
   xfconf_g_property_bind (channel, property, 
XFCE_TYPE_INDICATOR_CONFIG_VALUE_ARRAY, config, known-indicators);
   g_free (property);
+
+  g_signal_emit (G_OBJECT (config), 
indicator_config_signals[CONFIGURATION_CHANGED], 0);
 }
 
   return config;
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-indicator-plugin:master Using 22px icon size by default.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 8c1c94439f5f7ba5e91f9c63ea7307c885de092c (commit)
   from dd4f96d9db59a24ad421fc13e8c633a384ce92a4 (commit)

commit 8c1c94439f5f7ba5e91f9c63ea7307c885de092c
Author: Andrzej ndrwr...@gmail.com
Date:   Fri Mar 22 00:36:35 2013 +

Using 22px icon size by default.

This is the size of icons most (all?) indicators provide.

 panel-plugin/indicator-button.c |2 +-
 panel-plugin/indicator-config.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 0508674..8b269a6 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -465,7 +465,7 @@ xfce_indicator_button_get_icon_size (XfceIndicatorButton 
*button)
   gint border_thickness;
   GtkStyle*style;
 
-  g_return_val_if_fail (XFCE_IS_INDICATOR_BUTTON (button), 24);
+  g_return_val_if_fail (XFCE_IS_INDICATOR_BUTTON (button), 22);
 
   indicator_size = xfce_indicator_button_get_size (button);
 
diff --git a/panel-plugin/indicator-config.c b/panel-plugin/indicator-config.c
index c4bcf16..d5f5cda 100644
--- a/panel-plugin/indicator-config.c
+++ b/panel-plugin/indicator-config.c
@@ -45,7 +45,7 @@
 
 
 
-#define DEFAULT_ICON_SIZE_MAX  24
+#define DEFAULT_ICON_SIZE_MAX  22
 #define DEFAULT_ALIGN_LEFT FALSE
 #define DEFAULT_EXCLUDED_MODULES   NULL
 #define DEFAULT_ORIENTATIONGTK_ORIENTATION_HORIZONTAL
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-indicator-plugin:master Fixed crash on Xfce 4.8 (no xfce_dialog_show_help)

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to bc0abf05233f99011c77d4d6dd27943059be37bd (commit)
   from 8eb305349bff65313d8300defa8918675cc38bf6 (commit)

commit bc0abf05233f99011c77d4d6dd27943059be37bd
Author: Andrzej ndrwr...@gmail.com
Date:   Fri Mar 22 00:30:15 2013 +

Fixed crash on Xfce 4.8 (no xfce_dialog_show_help)

Online help doesn't seem to work anyway (no page on docs.xfce.org for
non-core plugins), so for now have reverted to
goodies.xfce.org.

 panel-plugin/indicator-dialog.c |   75 +--
 1 files changed, 56 insertions(+), 19 deletions(-)

diff --git a/panel-plugin/indicator-dialog.c b/panel-plugin/indicator-dialog.c
index 7422231..39280b5 100644
--- a/panel-plugin/indicator-dialog.c
+++ b/panel-plugin/indicator-dialog.c
@@ -41,6 +41,13 @@
 #include indicator-dialog.h
 #include indicator-dialog_ui.h
 
+#define PLUGIN_WEBSITE  
http://goodies.xfce.org/projects/panel-plugins/xfce4-indicator-plugin;
+
+#ifdef LIBXFCE4UI_CHECK_VERSION
+#if LIBXFCE4UI_CHECK_VERSION (4,9,0)
+#define HAS_ONLINE_HELP
+#endif
+#endif
 
 
 /* known indicator names */
@@ -60,10 +67,12 @@ static const gchar *pretty_names[][3] =
 
 #define ICON_SIZE (22)
 
-static void  indicator_dialog_build   (IndicatorDialog 
 *dialog);
-static void  indicator_dialog_response(GtkWidget   
 *window,
-   gint
  response_id,
-   IndicatorDialog 
 *dialog);
+static void  indicator_dialog_build  
(IndicatorDialog  *dialog);
+static void  indicator_dialog_close_button_clicked   
(IndicatorDialog  *dialog,
+  GtkWidget
*button);
+
+static void  indicator_dialog_help_button_clicked
(IndicatorDialog  *dialog,
+  GtkWidget
*button);
 
 
 
@@ -454,8 +463,18 @@ indicator_dialog_build (IndicatorDialog *dialog)
 
   dialog-dialog = gtk_builder_get_object (builder, dialog);
   g_return_if_fail (XFCE_IS_TITLED_DIALOG (dialog-dialog));
-  g_signal_connect (G_OBJECT (dialog-dialog), response,
-G_CALLBACK (indicator_dialog_response), dialog);
+
+  object = gtk_builder_get_object (builder, close-button);
+  g_return_if_fail (GTK_IS_BUTTON (object));
+  g_signal_connect_swapped (G_OBJECT (object), clicked,
+G_CALLBACK 
(indicator_dialog_close_button_clicked),
+dialog);
+
+  object = gtk_builder_get_object (builder, help-button);
+  g_return_if_fail (GTK_IS_BUTTON (object));
+  g_signal_connect_swapped (G_OBJECT (object), clicked,
+G_CALLBACK 
(indicator_dialog_help_button_clicked),
+dialog);
 
   object = gtk_builder_get_object (builder, size-max);
   g_return_if_fail (GTK_IS_WIDGET (object));
@@ -518,23 +537,41 @@ indicator_dialog_build (IndicatorDialog *dialog)
 
 
 static void
-indicator_dialog_response (GtkWidget*window,
-   gint  response_id,
-   IndicatorDialog  *dialog)
+indicator_dialog_close_button_clicked (IndicatorDialog *dialog,
+   GtkWidget   *button)
 {
-  g_return_if_fail (GTK_IS_DIALOG (window));
   g_return_if_fail (XFCE_IS_INDICATOR_DIALOG (dialog));
+  g_return_if_fail (GTK_IS_BUTTON (button));
+  g_return_if_fail (GTK_IS_WINDOW (dialog-dialog));
 
-  if (response_id == GTK_RESPONSE_HELP)
-{
-  xfce_dialog_show_help (GTK_WINDOW (window), xfce4-indicator, dialog, 
NULL);
-}
-  else
-{
-  gtk_widget_destroy (window);
+  gtk_widget_destroy (GTK_WIDGET (dialog-dialog));
+  g_object_unref (G_OBJECT (dialog));
+}
 
-  g_object_unref (G_OBJECT (dialog));
-}
+
+static void
+indicator_dialog_help_button_clicked (IndicatorDialog *dialog,
+  GtkWidget   *button)
+{
+  //#ifndef HAS_ONLINE_HELP
+  gboolean result;
+  //#endif
+
+  g_return_if_fail (XFCE_IS_INDICATOR_DIALOG (dialog));
+  g_return_if_fail (GTK_IS_BUTTON (button));
+  g_return_if_fail (GTK_IS_WINDOW (dialog-dialog));
+
+  /* Doesn't seem to work */
+  //#ifdef HAS_ONLINE_HELP
+  //xfce_dialog_show_help (GTK_WINDOW (dialog-dialog), xfce4-indicator, 
dialog, NULL);
+  //#else
+
+  result = g_spawn_command_line_async (exo-open --launch WebBrowser  
PLUGIN_WEBSITE, NULL);
+
+  if (G_UNLIKELY (result == FALSE))
+g_warning (_(Unable to open the following url: %s), PLUGIN_WEBSITE);
+
+  //#endif
 }
 
 
___
Xfce4-commits mailing list

[Xfce4-commits] xfce4-indicator-plugin:master Added an About dialog.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to dd4f96d9db59a24ad421fc13e8c633a384ce92a4 (commit)
   from bc0abf05233f99011c77d4d6dd27943059be37bd (commit)

commit dd4f96d9db59a24ad421fc13e8c633a384ce92a4
Author: Andrzej ndrwr...@gmail.com
Date:   Fri Mar 22 00:31:56 2013 +

Added an About dialog.

 panel-plugin/indicator.c |   32 
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/indicator.c b/panel-plugin/indicator.c
index d5d56f8..26d0ebb 100644
--- a/panel-plugin/indicator.c
+++ b/panel-plugin/indicator.c
@@ -53,6 +53,7 @@ static void indicator_construct   
 (XfcePanelPlu
 static void indicator_free 
(XfcePanelPlugin   *plugin);
 static gboolean load_module(const 
gchar   *name,
 
IndicatorPlugin   *indicator);
+static void indicator_show_about   
(XfcePanelPlugin   *plugin);
 static void indicator_configure_plugin 
(XfcePanelPlugin   *plugin);
 static gboolean indicator_size_changed 
(XfcePanelPlugin   *plugin,
 gint   
size);
@@ -99,6 +100,7 @@ indicator_class_init (IndicatorPluginClass *klass)
   plugin_class-construct = indicator_construct;
   plugin_class-free_data = indicator_free;
   plugin_class-size_changed = indicator_size_changed;
+  plugin_class-about = indicator_show_about;
   plugin_class-configure_plugin = indicator_configure_plugin;
 #ifdef HAS_PANEL_49
   plugin_class-mode_changed = indicator_mode_changed;
@@ -135,6 +137,35 @@ indicator_free (XfcePanelPlugin *plugin)
 
 
 static void
+indicator_show_about (XfcePanelPlugin *plugin)
+{
+   GdkPixbuf *icon;
+
+   const gchar *auth[] = {
+ Mark Trompell m...@foresightlinux.org, Andrzej Radecki 
ndrwr...@gmail.com,
+ Lionel Le Folgoc lio...@lefolgoc.net, Jason Conti 
jco...@launchpad.net,
+ Nick Schermer n...@xfce.org, Evgeni Golov evg...@debian.org, NULL 
};
+
+   g_return_if_fail (XFCE_IS_INDICATOR_PLUGIN (plugin));
+
+   icon = xfce_panel_pixbuf_from_source(xfce4-indicator-plugin, NULL, 32);
+   gtk_show_about_dialog(NULL,
+ logo, icon,
+ license, xfce_get_license_text 
(XFCE_LICENSE_TEXT_GPL),
+ version, PACKAGE_VERSION,
+ program-name, PACKAGE_NAME,
+ comments, _(An indicator of something that needs 
your attention on the desktop),
+ website, 
http://goodies.xfce.org/projects/panel-plugins/xfce4-indicator-plugin;,
+ copyright, _(Copyright (c) 2009-2013\n),
+ authors, auth, NULL);
+
+   if(icon)
+ g_object_unref(G_OBJECT(icon));
+}
+
+
+
+static void
 indicator_configure_plugin (XfcePanelPlugin *plugin)
 {
   IndicatorPlugin *indicator = XFCE_INDICATOR_PLUGIN (plugin);
@@ -202,6 +233,7 @@ indicator_construct (XfcePanelPlugin *plugin)
   GtkWidget*label;
 
   xfce_panel_plugin_menu_show_configure (plugin);
+  xfce_panel_plugin_menu_show_about (plugin);
 
   /* setup transation domain */
   xfce_textdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, UTF-8);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-indicator-plugin:master indicator-button: minor fix to gtk_menu_popup call

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 985d34925075ffd8ea020cec1fd2e849d47aff83 (commit)
   from 23dfad6c95ba2502b2c5d6b0c26722c3e09ff59e (commit)

commit 985d34925075ffd8ea020cec1fd2e849d47aff83
Author: Andrzej ndrwr...@gmail.com
Date:   Tue Apr 2 20:17:03 2013 +0100

indicator-button: minor fix to gtk_menu_popup call

Getting time from the event structure rather than from
gtk_get_current_event_time(). It does not solve menu flicker
issues present in some indicators (appmenu, qt-sni etc), though.
They seem to originate from the indicator itself.

 panel-plugin/indicator-button.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 8b269a6..74ed022 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -579,9 +579,8 @@ xfce_indicator_button_button_press (GtkWidget  *widget,
   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),TRUE);
   gtk_menu_reposition (GTK_MENU (button-menu));
   gtk_menu_popup (button-menu, NULL, NULL,
-  xfce_panel_plugin_position_menu,
-  button-plugin,
-  1, gtk_get_current_event_time ());
+  xfce_panel_plugin_position_menu, button-plugin,
+  event-button, event-time);
   return TRUE;
 }
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-indicator-plugin:master Reworked indicator entry sorting

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 23dfad6c95ba2502b2c5d6b0c26722c3e09ff59e (commit)
   from 8c1c94439f5f7ba5e91f9c63ea7307c885de092c (commit)

commit 23dfad6c95ba2502b2c5d6b0c26722c3e09ff59e
Author: Andrzej ndrwr...@gmail.com
Date:   Fri Mar 22 01:37:16 2013 +

Reworked indicator entry sorting

Special case for libapplication.so, where entries have non-unique
location fields. Sorting them by name (at least the order is same
every time the panel is started).

 panel-plugin/indicator-box.c |   31 +--
 1 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index c39435e..4c9ae90 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -170,21 +170,38 @@ xfce_indicator_box_sort_buttons (gconstpointer a,
   XfceIndicatorButton *a0 = XFCE_INDICATOR_BUTTON (a);
   XfceIndicatorButton *b0 = XFCE_INDICATOR_BUTTON (b);
   guinta1, b1;
+  const gchar *a_io;
+  gint result = 0;
 
   a1 = xfce_indicator_button_get_pos (a0);
   b1 = xfce_indicator_button_get_pos (b0);
 
+  /* only need one */
+  a_io = xfce_indicator_button_get_io_name (a0);
+
+  // printf (=== %s, %s; %s, %s; %d, %d, xfce_indicator_button_get_io_name 
(a0), xfce_indicator_button_get_io_name (b0), xfce_indicator_button_get_entry 
(a0)-name_hint, xfce_indicator_button_get_entry (b0)-name_hint, a1, b1);
+
+  /* special case for Application indicators (unreliable ordering) */
+  /* always compare by name and ignore location field */
+  if (a_io != NULL  g_strcmp0 (a_io, libapplication.so) == 0)
+result = g_strcmp0 (xfce_indicator_button_get_entry(a0)-name_hint,
+xfce_indicator_button_get_entry(b0)-name_hint);
+
   /* group all entries with location==0 at the beginning of the list
* but don't sort them (they may depend on insertion order) */
 
+  if (result == 0  (a1 != 0 || b1 != 0))
+result = a1-b1;
+
   /* if there are two entries with the same non-zero location
* try to resolve their order by their name_hint */
-  if (a1 != 0  a1 == b1)
-return -g_strcmp0 (xfce_indicator_button_get_entry(a0)-name_hint,
-   xfce_indicator_button_get_entry(b0)-name_hint);
 
-  /* else, use the location field */
-  return (a1-b1);
+  if (result == 0)
+result =  g_strcmp0 (xfce_indicator_button_get_entry(a0)-name_hint,
+ xfce_indicator_button_get_entry(b0)-name_hint);
+
+  // printf ( - %d\n, result);
+  return result;
 }
 
 
@@ -204,7 +221,9 @@ xfce_indicator_box_add (GtkContainer *container,
 
   io_name = xfce_indicator_button_get_io_name (button);
   li = g_hash_table_lookup (box-children, io_name);
-  if (xfce_indicator_button_get_pos (button) == 0)
+  // printf (   +++ %s %s\n, io_name, xfce_indicator_button_get_entry 
(button)-name_hint);
+  if (g_strcmp0 (io_name, libapplication.so) != 0 
+  xfce_indicator_button_get_pos (button) == 0)
 li = g_list_append (li, button);
   else
 li = g_list_insert_sorted (li, button, xfce_indicator_box_sort_buttons);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-indicator-plugin:master Fixed #9040.

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to f60f6d59702faef79cb3c346002395cbd0696c86 (commit)
   from 985d34925075ffd8ea020cec1fd2e849d47aff83 (commit)

commit f60f6d59702faef79cb3c346002395cbd0696c86
Author: Andrzej ndrwr...@gmail.com
Date:   Wed Apr 3 01:46:26 2013 +0100

Fixed #9040.

This required getting replacing XfcePanelImage with GtkImage. The former
does not work reliably with non-square icons and added automatization
is not needed in this case.

Only horizontal non-square icons are supported (vertical will be squeezed
into a square shape). Non-square icons are rendered in a single row
(like indicators with labels).

 panel-plugin/indicator-box.c|   16 +
 panel-plugin/indicator-button.c |   63 ++
 panel-plugin/indicator-button.h |2 +
 3 files changed, 54 insertions(+), 27 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index 4c9ae90..c181009 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -336,7 +336,7 @@ xfce_indicator_box_size_request (GtkWidget  *widget,
   gint row;
   gint nrows;
   gint x;
-  gboolean has_label;
+  gboolean has_label, rectangular_icon;
   GtkOrientation   panel_orientation;
 
   panel_size = indicator_config_get_panel_size (box-config);
@@ -359,9 +359,10 @@ xfce_indicator_box_size_request (GtkWidget  *widget,
 
   gtk_widget_size_request (GTK_WIDGET (button), child_req);
   has_label = (xfce_indicator_button_get_label (button) != NULL);
+  rectangular_icon = xfce_indicator_button_is_icon_rectangular 
(button);
 
   /* wrap rows if column is overflowing or a label is encountered */
-  if (row  0  (has_label || row = nrows))
+  if (row  0  (has_label || row = nrows || rectangular_icon))
 {
   x += length;
   row = 0;
@@ -371,7 +372,7 @@ xfce_indicator_box_size_request (GtkWidget  *widget,
   length =
 MAX (length, (panel_orientation == GTK_ORIENTATION_HORIZONTAL) ? 
child_req.width :child_req.height);
 
-  if (has_label || row = nrows)
+  if (has_label || row = nrows || rectangular_icon)
 {
   x += length;
   row = 0;
@@ -416,7 +417,7 @@ xfce_indicator_box_size_allocate (GtkWidget *widget,
   gint length, width;
   gint row;
   gint nrows;
-  gboolean has_label;
+  gboolean has_label, rectangular_icon;
   GtkOrientation   panel_orientation;
 
   row = 0;
@@ -445,9 +446,10 @@ xfce_indicator_box_size_allocate (GtkWidget *widget,
   gtk_widget_get_child_requisition (GTK_WIDGET (button), child_req);
 
   has_label = (xfce_indicator_button_get_label (button) != NULL);
+  rectangular_icon = xfce_indicator_button_is_icon_rectangular 
(button);
 
   /* wrap rows if column is overflowing or a label is encountered */
-  if (row  0  (has_label || row = nrows))
+  if (row  0  (has_label || row = nrows || rectangular_icon))
 {
   x += length;
   y = 0;
@@ -455,7 +457,7 @@ xfce_indicator_box_size_allocate (GtkWidget *widget,
   length = 0;
 }
 
-  width = (has_label) ? panel_size : size;
+  width = (has_label || rectangular_icon) ? panel_size : size;
   length = MAX (length,
 (panel_orientation == GTK_ORIENTATION_HORIZONTAL) ? 
child_req.width :child_req.height);
 
@@ -479,7 +481,7 @@ xfce_indicator_box_size_allocate (GtkWidget *widget,
 
   gtk_widget_size_allocate (GTK_WIDGET (button), child_alloc);
 
-  if (has_label || row = nrows)
+  if (has_label || row = nrows || rectangular_icon)
 {
   x += length;
   y = 0;
diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 74ed022..25a3572 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -67,6 +67,7 @@ struct _XfceIndicatorButton
   GtkWidget*label;
   GtkWidget*icon;
   GtkWidget*orig_icon;
+  gboolean  rectangular_icon;
 
   gulongorig_icon_changed_id;
   gulongconfiguration_changed_id;
@@ -119,6 +120,7 @@ xfce_indicator_button_init (XfceIndicatorButton *button)
   button-icon = NULL;
   button-orig_icon_changed_id = 0;
   button-configuration_changed_id = 0;
+  button-rectangular_icon = FALSE;
 
   button-align_box = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
   gtk_container_add (GTK_CONTAINER (button), button-align_box);
@@ -214,8 +216,6 @@ xfce_indicator_button_update_layout (XfceIndicatorButton 
*button)
 gtk_label_set_angle (GTK_LABEL (button-label),
  

[Xfce4-commits] midori:master Unconditionally show Toolbar Style preference

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to 863c8dff9042ca5d964a9c608ac5994198eeba65 (commit)
   from 5876dbfd1138b37ca2b61c8f711fcbbd4ea34e09 (commit)

commit 863c8dff9042ca5d964a9c608ac5994198eeba65
Author: Christian Dywan christ...@twotoasts.de
Date:   Thu Apr 4 18:20:11 2013 +0200

Unconditionally show Toolbar Style preference

Apparently users like to tweak it for browsers despite some major
desktop environments not providing toolbar UI options.

 midori/midori-preferences.c |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/midori/midori-preferences.c b/midori/midori-preferences.c
index c54c25c..6415ac2 100644
--- a/midori/midori-preferences.c
+++ b/midori/midori-preferences.c
@@ -427,13 +427,10 @@ midori_preferences_set_settings (MidoriPreferences* 
preferences,
 
 /* Page Interface */
 PAGE_NEW (GTK_STOCK_CONVERT, _(Browsing));
-if (!g_getenv (DESKTOP_SESSION))
-{
 FRAME_NEW (NULL);
 INDENTED_ADD (gtk_label_new (_(Toolbar Style:)));
 button = katze_property_proxy (settings, toolbar-style, NULL);
 SPANNED_ADD (button);
-}
 FRAME_NEW (NULL);
 label = gtk_label_new (_(Open new pages in:));
 INDENTED_ADD (label);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] midori:master Prevent overlay frame from being caught by show_all

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to 102716cb3db86f3e6b5f469293039696ff3e24a4 (commit)
   from 863c8dff9042ca5d964a9c608ac5994198eeba65 (commit)

commit 102716cb3db86f3e6b5f469293039696ff3e24a4
Author: Christian Dywan christ...@twotoasts.de
Date:   Thu Apr 4 18:25:31 2013 +0200

Prevent overlay frame from being caught by show_all

Otherwise an empty frame may show even when the statusbar is shown.

 midori/midori-view.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/midori/midori-view.c b/midori/midori-view.c
index a292e4c..13ef417 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -3834,6 +3834,7 @@ midori_view_constructor (GType  type,
 /* Overlays must be created before showing GtkOverlay as of GTK+ 3.2 */
 {
 GtkWidget* frame = gtk_frame_new (NULL);
+gtk_widget_set_no_show_all (frame, TRUE);
 view-overlay_label = gtk_label_new (NULL);
 gtk_widget_show (view-overlay_label);
 gtk_container_add (GTK_CONTAINER (frame), view-overlay_label);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] midori:master makedist: Don't append timestamp to archive name for release versions.

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to 0d2ff336b5e552ced926ba0ef06564ba2c48c7c5 (commit)
   from 102716cb3db86f3e6b5f469293039696ff3e24a4 (commit)

commit 0d2ff336b5e552ced926ba0ef06564ba2c48c7c5
Author: Paweł Forysiuk tuxa...@o2.pl
Date:   Thu Apr 4 11:20:39 2013 +0200

makedist: Don't append timestamp to archive name for release versions.

 win32/makedist/makedist.midori |   12 +---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/win32/makedist/makedist.midori b/win32/makedist/makedist.midori
index 38114a3..c363342 100755
--- a/win32/makedist/makedist.midori
+++ b/win32/makedist/makedist.midori
@@ -56,11 +56,17 @@ else
 version_tag=$version
 fi
 
-# generate unique filename
+if [ $RELEASE ==  ]; then
+ARCHIVE_FILENAME=midori-$version_tag-`date +%Y%m%d%H%M`
+else
+ARCHIVE_FILENAME=midori-$version_tag
+fi
+
+# generate archive filename
 if [ $have_7zip !=   ]; then
-ARCHIVE=midori-$version_tag-`date +%Y%m%d%H%M`.7z
+ARCHIVE=$ARCHIVE_FILENAME.7z
 else
-ARCHIVE=midori-$version_tag-`date +%Y%m%d%H%M`.zip
+ARCHIVE=$ARCHIVE_FILENAME.zip
 fi
 
 # function: dll-recursive list of exe and dll files ...
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] midori:master Include gdb.exe in release builds and drop debug.bat

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to feb032138df5af9683e058bc67ca226a654979f6 (commit)
   from 0d2ff336b5e552ced926ba0ef06564ba2c48c7c5 (commit)

commit feb032138df5af9683e058bc67ca226a654979f6
Author: Paweł Forysiuk tuxa...@o2.pl
Date:   Thu Apr 4 18:30:02 2013 +0200

Include gdb.exe in release builds and drop debug.bat

 win32/makedist/makedist.midori |   19 +++
 1 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/win32/makedist/makedist.midori b/win32/makedist/makedist.midori
index c363342..d20f9da 100755
--- a/win32/makedist/makedist.midori
+++ b/win32/makedist/makedist.midori
@@ -43,10 +43,6 @@ grep -q gtk-3.0 _build/config.log  GTK3_BUILD=1
 version=`grep PACKAGE_VERSION _build/default/config.h | awk '{ print $3 $4; }' 
| sed 's@(debug)@-debug@g'|sed 's@@@g'`
 
 if [ $1 !=  ]; then
-   if [ $1 == debug ]; then
-   DEBUG_BUILD=1
-   shift
-   fi
version_tag=$1
 fi
 
@@ -126,9 +122,11 @@ dll_recursive midori*.exe gspawn-*-helper*.exe 
libhunspell*.dll  $temp_dir/mido
 dll_recursive ../lib/gio/modules/*.dll  $temp_dir/midori.exe.lst
 dll_recursive iconv.dll  $temp_dir/midori.exe.lst
 dll_recursive ../lib/gstreamer-$GSTREAMER_API_VERSION/*.dll  
$temp_dir/midori.exe.lst
+# we ship gdb now for -g and diagnostic button
+dll_recursive gdb.exe  $temp_dir/midori.exe.lst
 
 if [ $DEBUG_BUILD !=  ]; then
-dll_recursive gdb.exe GtkLauncher.exe  $temp_dir/midori.exe.lst
+dll_recursive GtkLauncher.exe  $temp_dir/midori.exe.lst
 fi
 
 files=`ls | cat - $temp_dir/midori.exe.lst | sort | uniq -d`
@@ -209,17 +207,6 @@ if [ $DEBUG_BUILD ==  ];then
 pushd $workdir  /dev/null
 find -iname *.debug -exec rm {} \;
 popd  /dev/null
-else
-#add some gdb helper scripts
-cat  $workdir/bin/backtrace.gdb  _EOF
-set logging on debug.log
-run
-thread apply all bt
-quit
-_EOF
-
-echo 'gdb.exe --command=backtrace.gdb midori.exe'  $workdir/bin/debug.bat
-
 fi
 
 # copy locales for gtk
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] midori:master makedist: Don't try removing gtk_rc file, it will be overwritten.

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to a5442dd8557e0db8fce31e70ba64839cdd738201 (commit)
   from feb032138df5af9683e058bc67ca226a654979f6 (commit)

commit a5442dd8557e0db8fce31e70ba64839cdd738201
Author: Paweł Forysiuk tuxa...@o2.pl
Date:   Thu Apr 4 11:26:23 2013 +0200

makedist: Don't try removing gtk_rc file, it will be overwritten.

Gets rid of annoying warning if file was non-existent.
While at it adjust comment about icon theme used.

 win32/makedist/makedist.midori |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/win32/makedist/makedist.midori b/win32/makedist/makedist.midori
index d20f9da..c0e2b43 100755
--- a/win32/makedist/makedist.midori
+++ b/win32/makedist/makedist.midori
@@ -232,10 +232,8 @@ else
 fi
 
 mkdir -p $gtk_etc_dir
-rm $gtk_rc_file
 
-
-# Use small icons by default and Tango theme
+# Use small icons by default and Faenza icon theme
 if [ $GTK3_BUILD == 1 ]; then
 
 cat  $gtk_rc_file  _EOF
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] midori:master nsis: Request admin rights when installing.

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to cb3fd5be2e1cca69b598a0c21386a3e3ead8df89 (commit)
   from a5442dd8557e0db8fce31e70ba64839cdd738201 (commit)

commit cb3fd5be2e1cca69b598a0c21386a3e3ead8df89
Author: Paweł Forysiuk tuxa...@o2.pl
Date:   Thu Apr 4 14:37:37 2013 +0200

nsis: Request admin rights when installing.

 win32/makedist/midori.nsi |9 -
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/win32/makedist/midori.nsi b/win32/makedist/midori.nsi
index 4ba91de..a8d4715 100644
--- a/win32/makedist/midori.nsi
+++ b/win32/makedist/midori.nsi
@@ -15,7 +15,7 @@
 
 ; Do a Cyclic Redundancy Check to make sure the installer was not corrupted by 
the download
 CRCCheck force
-RequestExecutionLevel user ; set execution level for Windows Vista
+RequestExecutionLevel admin ; set execution level for Windows Vista
 
 ;;;
 ; helper defines  ;
@@ -523,10 +523,9 @@ Function .onInit
${if} $Answer == yes
SetShellVarContext all ; set that e.g. shortcuts will be 
created for all users
${else}
-   SetShellVarContext current
-   ; TODO is this really what we want? $PROGRAMFILES is not much 
better because
-   ; probably the unprivileged user can't write it anyways
-   StrCpy $INSTDIR $PROFILE\$(^Name)
+   MessageBox mb_iconstop Administrator rights required - use the 
portable release if that's not possible
+   SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED
+   Quit
${endif}
 
; prevent running multiple instances of the installer
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] midori:master makedist: Support building nsis installer

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to e329ca3cb96665925412a56a9a119b7199f0171d (commit)
   from cb3fd5be2e1cca69b598a0c21386a3e3ead8df89 (commit)

commit e329ca3cb96665925412a56a9a119b7199f0171d
Author: Paweł Forysiuk tuxa...@o2.pl
Date:   Thu Apr 4 14:39:08 2013 +0200

makedist: Support building nsis installer

 win32/makedist/makedist.midori |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/win32/makedist/makedist.midori b/win32/makedist/makedist.midori
index c0e2b43..1022db0 100755
--- a/win32/makedist/makedist.midori
+++ b/win32/makedist/makedist.midori
@@ -65,6 +65,12 @@ else
 ARCHIVE=$ARCHIVE_FILENAME.zip
 fi
 
+if [ NSIS !=  ];then
+where_am_i=$PWD
+cp -a $where_am_i/win32/makedist/midori.nsi $temp_dir
+cp -a $where_am_i/win32/makedist/midori.ico $temp_dir
+fi
+
 # function: dll-recursive list of exe and dll files ...
 #
 # recursively search all dll dependencies of the input files.
@@ -275,6 +281,13 @@ if [ $have_7zip !=  ]; then
 else
 zip -rq $ARCHIVE midori-$version_tag
 fi
+
+if [ $NSIS !=  ];then
+nsis_file=Midori-${version}_setup.exe
+echo Creating $nsis_file
+makensis -NOCD -V2 ./midori.nsi
+mv $nsis_file $where_am_i
+fi
 popd  /dev/null
 
 echo * Cleaning up...
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] midori:master makedist: Compute sha1 checksum for generated files.

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to 1ea0faf59fcc3907b2c1fb4ef785e41fd32371b1 (commit)
   from e329ca3cb96665925412a56a9a119b7199f0171d (commit)

commit 1ea0faf59fcc3907b2c1fb4ef785e41fd32371b1
Author: Paweł Forysiuk tuxa...@o2.pl
Date:   Thu Apr 4 19:10:32 2013 +0200

makedist: Compute sha1 checksum for generated files.

 win32/makedist/makedist.midori |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/win32/makedist/makedist.midori b/win32/makedist/makedist.midori
index 1022db0..dea247d 100755
--- a/win32/makedist/makedist.midori
+++ b/win32/makedist/makedist.midori
@@ -294,3 +294,15 @@ echo * Cleaning up...
 
 # remove working directory
 rm -r $temp_dir
+
+
+echo * Computing checksums...
+
+sum_file=midori-$version.sha1
+sha1sum $ARCHIVE  $sum_file
+
+if [ $NSIS !=  ]; then
+sha1sum $nsis_file  $sum_file
+fi
+
+cat $sum_file
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] midori:master Store --execute arguments in string array

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to 00bb2bcedb3fccd78d9744e8582fff0de9f95886 (commit)
   from 1ea0faf59fcc3907b2c1fb4ef785e41fd32371b1 (commit)

commit 00bb2bcedb3fccd78d9744e8582fff0de9f95886
Author: Christian Dywan christ...@twotoasts.de
Date:   Thu Apr 4 19:35:27 2013 +0200

Store --execute arguments in string array

To allow passing any number of --execute and URLs at once.

 midori/main.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/midori/main.c b/midori/main.c
index 4dcfcab..9be9d4d 100644
--- a/midori/main.c
+++ b/midori/main.c
@@ -78,7 +78,7 @@ main (intargc,
 gboolean debug = FALSE;
 gboolean run;
 gchar* snapshot;
-gboolean execute;
+gchar** execute;
 gboolean help_execute;
 gboolean version;
 gchar** uris;
@@ -106,7 +106,7 @@ main (intargc,
N_(Run the specified filename as javascript), NULL },
{ snapshot, 's', 0, G_OPTION_ARG_STRING, snapshot,
N_(Take a snapshot of the specified URI), NULL },
-   { execute, 'e', 0, G_OPTION_ARG_NONE, execute,
+   { execute, 'e', 0, G_OPTION_ARG_STRING_ARRAY, execute,
N_(Execute the specified command), NULL },
{ help-execute, 0, 0, G_OPTION_ARG_NONE, help_execute,
N_(List available commands to execute with -e/ --execute), NULL },
@@ -132,7 +132,7 @@ main (intargc,
 plain = FALSE;
 run = FALSE;
 snapshot = NULL;
-execute = FALSE;
+execute = NULL;
 help_execute = FALSE;
 version = FALSE;
 uris = NULL;
@@ -374,7 +374,7 @@ main (intargc,
 if (private)
 {
 MidoriBrowser* browser = midori_private_app_new (config, webapp,
-execute ? NULL : uris, execute ? uris : NULL, inactivity_reset, 
block_uris);
+uris, execute, inactivity_reset, block_uris);
 g_signal_connect (browser, destroy, G_CALLBACK (gtk_main_quit), 
NULL);
 g_signal_connect (browser, quit, G_CALLBACK (gtk_main_quit), NULL);
 gtk_main ();
@@ -384,7 +384,7 @@ main (intargc,
 if (webapp)
 {
 MidoriBrowser* browser = midori_web_app_new (config, webapp,
-execute ? NULL : uris, execute ? uris : NULL, inactivity_reset, 
block_uris);
+uris, execute, inactivity_reset, block_uris);
 g_signal_connect (browser, destroy, G_CALLBACK (gtk_main_quit), 
NULL);
 g_signal_connect (browser, quit, G_CALLBACK (gtk_main_quit), NULL);
 gtk_main ();
@@ -393,7 +393,7 @@ main (intargc,
 
 MidoriApp* app = midori_normal_app_new (config,
 portable ? portable : normal, diagnostic_dialog, webapp,
-execute ? NULL : uris, execute ? uris : NULL, inactivity_reset, 
block_uris);
+uris, execute, inactivity_reset, block_uris);
 if (app == NULL)
 return 0;
 if (app == (void*)0xdeadbeef)
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] midori:master makedist: Don't include version_tag in archive main folder name.

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to 7bb735edc8f53b2bad82b1ad4d259ab46d1b3c21 (commit)
   from 00bb2bcedb3fccd78d9744e8582fff0de9f95886 (commit)

commit 7bb735edc8f53b2bad82b1ad4d259ab46d1b3c21
Author: Paweł Forysiuk tuxa...@o2.pl
Date:   Thu Apr 4 19:29:27 2013 +0200

makedist: Don't include version_tag in archive main folder name.

 win32/makedist/makedist.midori |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/win32/makedist/makedist.midori b/win32/makedist/makedist.midori
index dea247d..0dd4129 100755
--- a/win32/makedist/makedist.midori
+++ b/win32/makedist/makedist.midori
@@ -47,7 +47,7 @@ if [ $1 !=  ]; then
 fi
 
 if [ $version_tag !=  ]; then
-version_tag=$version_tag-$version
+version_tag=$version-$version_tag
 else
 version_tag=$version
 fi
@@ -117,7 +117,7 @@ grab_files ()
 echo Creating $ARCHIVE
 
 # create destination folder
-workdir=$temp_dir/midori-$version_tag
+workdir=$temp_dir/midori-$version
 mkdir $workdir
 
 echo * Generating dll list...
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] midori:master Add xvfb-based automated screenshot tool

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to 9c89becb0d42254563067c18a74702aacbf1876d (commit)
   from 7bb735edc8f53b2bad82b1ad4d259ab46d1b3c21 (commit)

commit 9c89becb0d42254563067c18a74702aacbf1876d
Author: Christian Dywan christ...@twotoasts.de
Date:   Thu Apr 4 21:10:10 2013 +0200

Add xvfb-based automated screenshot tool

 tools/screenshot |   83 ++
 1 files changed, 83 insertions(+), 0 deletions(-)

diff --git a/tools/screenshot b/tools/screenshot
new file mode 100755
index 000..110b923
--- /dev/null
+++ b/tools/screenshot
@@ -0,0 +1,83 @@
+#! /bin/sh
+# Copyright (C) 2013 Christian Dywan christ...@twotoasts.de
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# See the file COPYING for the full license text.
+
+xvfbonce() {
+xvfb-run --server-args='-fbdir /tmp -screen 0 1024x768x16' \
+env LANGUAGE= UBUNTU_MENUPROXY= MOZ_PLUGIN_PATH=/ SCREENCHILD=42 $0 $1 
$2 21 | grep -v RANDR
+}
+
+if test $SCREENCHILD = 42; then
+(xfwm4 || metacity) 21 | grep -v XRandr | grep -v 'Fatal IO error' 
+sleep 2; kill -0 $! || exit $?
+if test $1 = midori; then
+echo Processing case $2
+CFG=/tmp/midori-scrn/$2
+PNG=$CFG.png
+test -d $CFG  rm -R $CFG; mkdir -p $CFG
+mkdir -p $CFG/midori
+mkdir -p $CFG/gtk-3.0
+echo '[Settings]'  $CFG/gtk-3.0/settings.ini
+test -n $GTK_THEME  echo gtk-theme-name=$GTK_THEME  
$CFG/gtk-3.0/settings.ini
+test -n $ICON_THEME  echo gtk-icon-theme-name=$ICON_THEME  
$CFG/gtk-3.0/settings.ini
+export XDG_CONFIG_HOME; XDG_CONFIG_HOME=$CFG
+echo '[settings]'  $CFG/midori/config
+echo 'last-window-state=MIDORI_WINDOW_MAXIMIZED'  $CFG/midori/config
+EXE=-e toolbar-style=MIDORI_TOOLBAR_ICONS
+URLS=http://.invalid about:version http://en.wikipedia.org/wiki/Cat;
+if test $2 = 1; then
+EXE=$EXE -e BookmarkAdd
+elif test $2 = 2; then
+EXE=$EXE $URLS -e Panel -e libtab-panel.so=true
+echo 'last-panel-page=3'  $CFG/config
+elif test $2 = 3; then
+EXE=$EXE -e Preferences
+elif test $2 = 4; then
+EXE=$EXE -e ClearPrivateData
+elif test $2 = 5; then
+EXE=$EXE -e Find
+elif test $2 = 6; then
+EXE=$EXE -e ManageSearchEngines
+fi
+_build/default/midori/midori $EXE 21 \
+| grep -v 'Theme parsing error' \
+| grep -E -v '\[[0-9]{3}:[0-9]{3}\]' \
+| grep -v 'Fatal IO error' \
+| uniq 
+elif test $1 = custom; then
+if test $2 = ; then
+echo 'Argument required'
+exit 1
+fi
+PNG=/tmp/screenshot-custom.png
+$2 
+else
+echo Unknown scenario $2
+exit 1
+fi
+sleep 2; kill -0 $! || exit $?
+sleep 14
+# test ! -f /tmp/Xvfb_screen0  echo Xvfb produced no memory image  
exit 1
+# convert /tmp/Xvfb_screen0 $PNG
+WINDOW=$(xprop -root | grep --color=never '_NET_ACTIVE_WINDOW(WINDOW)' | 
sed 's@_NET_ACTIVE_WINDOW(WINDOW): window id # @@g')
+import -frame -window $WINDOW $PNG || exit 1
+echo Screenshot $PNG saved
+exit 0
+elif test $1 = midori; then
+for i in 1 2 3 4 5 6; do
+xvfbonce $1 $i
+done
+elif test $1 = custom; then
+xvfbonce $1 $2
+else
+echo Usage:
+echo   $0 midori
+echo   $0 custom 'commandline --with -a rguments'
+fi
+
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] midori:master Add helper script for building and uploading win32 releases

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to a7738f8cf3f0b8a6a7aea022a355c3727dfdd99e (commit)
   from 9c89becb0d42254563067c18a74702aacbf1876d (commit)

commit a7738f8cf3f0b8a6a7aea022a355c3727dfdd99e
Author: Paweł Forysiuk tuxa...@o2.pl
Date:   Thu Apr 4 21:01:43 2013 +0200

Add helper script for building and uploading win32 releases

 win32/makedist/win32-release |   59 ++
 1 files changed, 59 insertions(+), 0 deletions(-)

diff --git a/win32/makedist/win32-release b/win32/makedist/win32-release
new file mode 100755
index 000..375f4b6
--- /dev/null
+++ b/win32/makedist/win32-release
@@ -0,0 +1,59 @@
+#!/bin/bash
+
+# Copyright (C) 2013 Paweł Forysiuk tuxa...@o2.pl
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# See the file COPYING for the full license text.
+
+
+version=$(git describe --abbrev=0)
+dropbox_dir=$HOME/Dropbox/Public
+
+# 32-bit build
+#mingw32-env
+export MINGW_PREFIX=/usr/i686-w64-mingw32/sys-root/mingw
+eval `rpm --eval %{mingw32_env}`
+
+./configure --prefix=$MINGW_PREFIX --enable-gtk3
+make clean
+make install
+
+rpmquery -qa mingw32*  midori-${version}-deps-i686.txt
+rm -f midori-$version.sha1
+
+MINGW_PREFIX=${MINGW_PREFIX} RELEASE=1 NSIS=1 ./win32/makedist/makedist.midori
+mv -v midori-${version}.7z $dropbox_dir
+mv -v Midori-${version}_setup.exe $dropbox_dir
+
+dropbox puburl $dropbox_dir/midori-${version}.7z   release_links.txt
+dropbox puburl $dropbox_dir/Midori-${version}_setup.exe  release_links.txt
+
+if [ $NO_64BIT !=  ]; then
+# 64-bit build
+#mingw64-env
+export MINGW_PREFIX=/usr/x86_64-w64-mingw32/sys-root/mingw
+eval `rpm --eval %{mingw64_env}`
+
+./configure --prefix=$MINGW_PREFIX --enable-gtk3
+make clean
+make install
+
+rpmquery -qa mingw64*  midori-${version}-deps-x86_64.txt
+MINGW_PREFIX=${MINGW_PREFIX} RELEASE=1 sh ./win32/makedist/makedist.midori 
x86_64-portable
+mv -v midori-${version}-x86_64-portable.7z $dropbox_dir
+dropbox puburl $dropbox_dir/midori-${version}-x86_64-portable.7z  
release_links.txt
+fi
+
+echo
+echo =
+echo Midori win32 release details:
+echo Download links:
+cat release_links.txt
+echo Checksums:
+cat midori-$version.sha1
+echo =
+echo
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] midori:master Bump version to 0.5.0

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to 901d547c40cc16d752765c475a0f55da20e2352f (commit)
   from a7738f8cf3f0b8a6a7aea022a355c3727dfdd99e (commit)

commit 901d547c40cc16d752765c475a0f55da20e2352f
Author: Christian Dywan christ...@twotoasts.de
Date:   Thu Apr 4 22:31:20 2013 +0200

Bump version to 0.5.0

 ChangeLog |   42 ++
 data/faq.html |   45 +
 win32/makedist/midori.nsi |2 +-
 wscript   |2 +-
 4 files changed, 69 insertions(+), 22 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4c34985..ccfb036 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,47 @@
 This file is licensed under the terms of the expat license, see the file EXPAT.
 
+v0.5.0:
+ Store --execute arguments in string array
+ Prevent overlay frame from being caught by show_all
+ Unconditionally show Toolbar Style preference
+ Duplicate current URI when reloading Midori.View
+ Update tabs being closable on setting change in Granite
+ Check default_search before setting SearchAction default
+ Populate application chooser button in idle
+ Bail out of completion resizing if cell height is 0
+ Pass proxy to bookmark dialog when editing via menu
+ Tweak bookmark dialog, button to buttons, toggles side by side
+ Move 'Flash windows' option into History List
+ Use light window for Clear Private Data with Granite
+ Use GtkFontButton with filter func with GTK+ 3.2
+ Implement 'Run in debugger' button in diagnostic dialog
+ Add Win32 work-around to History List for modifiers
+ Make toolbar drag/ drop work in GTK+3
+ Check if active form element is input before getting search text
+ Implement direction-based mouse gesture configuration
+ Implement mouse movement, load-failed, crashed, search in WebKit2
+ Add 'Show last crash log' button to diagnostic dialog
+ Make invalid actions fail; exit on error in new process only
+ Accept setting=value and extension=true/ false in --execute
+ Merged cookie permissions as of 2013-03-08
+ Gray out webGL preference if context is unavailable
+ Use browser API to Close Other in view menu item
+ Fix periods to ellipsis in Custom/ Customize Shortcuts
+ Support Colorful Tabs in History List
+ Add Midori.Tab.fg/ bg_color and Midori.View.set_colors
+ Fix word-wrap, #decription and #message in about.css
+ Set view scroll policy to Never to avoid flickering
+ Use XDG_RUNTIME_DIR for temporary files
+ Build Vala and C parts of core separately
+ Don't provide default value for enable-scripts
+ Respect Open new pages: window for Web Search and Open Image
+ enable-javascript in WebKit1/ 2, macro for (Web)Settings
+ Fix MIDORI_*_VERSION to be integers
+ Fix .desktop file validation unit test and fix errors
+ 'New tab behavior' preference: about:dial/ new/ search/ home alias URLs
+ Use stripped down XBEL variant for session and trash
+ Allow any proxies supported by libproxy; list supported types in preferences
+
 v0.4.9:
  Let non-Granite security window behave like a window
  Disable Contractor support in Granite for now
diff --git a/data/faq.html b/data/faq.html
index 4254966..5335436 100644
--- a/data/faq.html
+++ b/data/faq.html
@@ -5,7 +5,7 @@
   titlemidori:faq/title
 meta name=generator content=DokuWiki/
 meta name=robots content=index,follow/
-meta name=date content=2013-02-14T01:16:17+0100/
+meta name=date content=2013-03-23T11:08:29+0100/
 meta name=keywords content=midori,faq/
 link rel=search type=application/opensearchdescription+xml 
href=/lib/exe/opensearch.php title=Xfce Wiki/
 link rel=start href=//
@@ -240,7 +240,7 @@ Midori gt;= 0.4.7 automatically picks up the 
Strict-Transport-Security header a
 div class=level4
 
 p
-Midori gt;= 0.4.7 supports a href=/midori/gcr class=wikilink2 
title=midori:gcr rel=nofollowhttp://git.gnome.org/browse/gcr/tree/gcr/a 
for certificate display and management, you can click the lock in the urlbar to 
see detailed information. Earlier versions, or one without gcr will not handle 
certificates beyond the lock icon in the urlbar.
+Midori gt;= 0.4.7 supports a href=http://git.gnome.org/browse/gcr/tree/gcr; 
class=urlextern title=http://git.gnome.org/browse/gcr/tree/gcr;  
rel=nofollowgcr/a for certificate display and management, you can click 
the lock in the urlbar to see detailed information. Earlier versions, or one 
without gcr will not handle certificates beyond the lock icon in the urlbar.
 /p
 
 /div
@@ -299,9 +299,10 @@ You can either run that above line and run Midori in the 
same terminal afterward
 div class=level4
 
 p
-nspluginwrapper is a program that runs Flash and other Netscape plugins in a 
separate process. So a crash can#039;t cresh the whole browser and Flash, 
which is GTK+2 can run in GTK+3.
+nspluginwrapper is a program that runs Flash and other Netscape plugins in a 
separate process. So a crash can#039;t crash the whole browser and Flash, 
which is GTK+2 can run in GTK+3.
 /p
-pre class=code bashspan 

[Xfce4-commits] midori|0.5.0 Creating annotated tag 0.5.0

2013-04-04 Thread Christian Dywan
Updating annotated tag refs/tags/0.5.0
 as new annotated tag
 to ef90e0e8e53b49246b7e8224a1a5b5cb29d00ce8 (tag)
   succeeds 0.4.9-174-ga7738f8
  tagged by Christian Dywan christ...@twotoasts.de
 on 2013-04-04 22:31 +0200

Christian Dywan (1):
  Bump version to 0.5.0

___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] midori:master Abstract view-source for WebKit1/ 2 in Midori.Tab

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to f8d82b437b0b2cd0ee0cb62d473940f9c340ce70 (commit)
   from 901d547c40cc16d752765c475a0f55da20e2352f (commit)

commit f8d82b437b0b2cd0ee0cb62d473940f9c340ce70
Author: Christian Dywan christ...@twotoasts.de
Date:   Thu Apr 4 23:23:44 2013 +0200

Abstract view-source for WebKit1/ 2 in Midori.Tab

 extensions/addons.c|3 +--
 midori/midori-browser.c|4 +---
 midori/midori-tab.vala |   28 +---
 midori/midori-view.c   |4 +---
 midori/webkit2gtk-3.0.vapi |6 ++
 tests/tab.vala |   15 +++
 6 files changed, 33 insertions(+), 27 deletions(-)

diff --git a/extensions/addons.c b/extensions/addons.c
index 1ce19c4..e157840 100644
--- a/extensions/addons.c
+++ b/extensions/addons.c
@@ -243,9 +243,8 @@ addons_notify_load_status_cb (MidoriView*  view,
   MidoriExtension* extension)
 {
 const gchar* uri = midori_view_get_display_uri (view);
-WebKitWebView* web_view = WEBKIT_WEB_VIEW (midori_view_get_web_view 
(view));
 
-if (webkit_web_view_get_view_source_mode (web_view))
+if (midori_tab_get_view_source (MIDORI_TAB (view)))
 return;
 
 if (uri  *uri)
diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index a997f7f..3ceb8e3 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -3505,9 +3505,7 @@ _action_source_view_activate (GtkAction* action,
 
 source = midori_view_new_with_item (NULL, browser-settings);
 source_view = midori_view_get_web_view (MIDORI_VIEW (source));
-#ifndef HAVE_WEBKIT2
-webkit_web_view_set_view_source_mode (WEBKIT_WEB_VIEW (source_view), 
TRUE);
-#endif
+midori_tab_set_view_source (MIDORI_TAB (source_view), TRUE);
 webkit_web_view_load_uri (WEBKIT_WEB_VIEW (source_view), source_uri);
 midori_browser_add_tab (browser, source);
 }
diff --git a/midori/midori-tab.vala b/midori/midori-tab.vala
index fd300e8..94a24ec 100644
--- a/midori/midori-tab.vala
+++ b/midori/midori-tab.vala
@@ -136,9 +136,26 @@ namespace Midori {
 #endif
 }
 
+#if HAVE_WEBKIT2
+public bool view_source { get {
+return web_view.view_mode == WebKit.ViewMode.SOURCE;
+}
+set {
+web_view.view_mode = value ? WebKit.ViewMode.SOURCE : 
WebKit.ViewMode.WEB;
+}
+}
+#else
+public bool view_source { get {
+return web_view.get_view_source_mode ();
+}
+set {
+web_view.set_view_source_mode (value);
+}
+}
+#endif
+
 public bool can_view_source () {
-#if !HAVE_WEBKIT2
-if (is_blank () || special || web_view.get_view_source_mode ())
+if (is_blank () || special || view_source)
 return false;
 string content_type = ContentType.from_mime_type (mime_type);
 #if HAVE_WIN32
@@ -148,9 +165,6 @@ namespace Midori {
 string text_type = ContentType.from_mime_type (text/plain);
 #endif
 return ContentType.is_a (content_type, text_type);
-#else
-return true;
-#endif
 }
 
 public static string get_display_title (string? title, string uri) {
@@ -191,11 +205,11 @@ namespace Midori {
 
 /* Since: 0.4.3 */
 public bool can_save () {
-#if !HAVE_WEBKIT2
 if (is_blank () || special)
 return false;
-if (web_view.get_view_source_mode ())
+if (view_source)
 return false;
+#if !HAVE_WEBKIT2
 if (web_view.get_main_frame ().get_data_source ().get_data () == 
null)
 return false;
 #endif
diff --git a/midori/midori-view.c b/midori/midori-view.c
index 13ef417..7350023 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -4337,9 +4337,7 @@ midori_view_set_uri (MidoriView*  view,
 midori_tab_set_uri (MIDORI_TAB (view), uri);
 katze_item_set_uri (view-item, midori_tab_get_uri (MIDORI_TAB 
(view)));
 katze_assign (view-title, NULL);
-#ifndef HAVE_WEBKIT2
-webkit_web_view_set_view_source_mode (WEBKIT_WEB_VIEW 
(view-web_view), FALSE);
-#endif
+midori_tab_set_view_source (MIDORI_TAB (view), FALSE);
 webkit_web_view_load_uri (WEBKIT_WEB_VIEW (view-web_view), uri);
 }
 g_free (temporary_uri);
diff --git a/midori/webkit2gtk-3.0.vapi b/midori/webkit2gtk-3.0.vapi
index 34766bd..0279812 100644
--- a/midori/webkit2gtk-3.0.vapi
+++ b/midori/webkit2gtk-3.0.vapi
@@ -464,6 +464,11 @@ namespace WebKit {
public signal void received_data (uint64 data_length);
public signal void sent_request (WebKit.URIRequest request, 
WebKit.URIResponse redirected_response);
}
+   [CCode (cheader_filename = webkit2/webkit2.h, cprefix = 
WEBKIT_VIEW_MODE_)]
+   public enum ViewMode {
+   WEB,
+   SOURCE
+   }

[Xfce4-commits] midori:master Implement plugin listing for WebKit2 and abstract skip_plugin

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to 0c0549f9efe0f00e3b3537b7a091ee36afeabf5a (commit)
   from f8d82b437b0b2cd0ee0cb62d473940f9c340ce70 (commit)

commit 0c0549f9efe0f00e3b3537b7a091ee36afeabf5a
Author: Christian Dywan christ...@twotoasts.de
Date:   Thu Apr 4 23:31:07 2013 +0200

Implement plugin listing for WebKit2 and abstract skip_plugin

 extensions/nsplugin-manager.vala |2 +-
 midori/midori-view.c |   42 -
 midori/midori-websettings.c  |   13 +++
 midori/midori-websettings.h  |3 ++
 midori/midori.vapi   |1 +
 5 files changed, 50 insertions(+), 11 deletions(-)

diff --git a/extensions/nsplugin-manager.vala b/extensions/nsplugin-manager.vala
index 2d769f0..adebb77 100644
--- a/extensions/nsplugin-manager.vala
+++ b/extensions/nsplugin-manager.vala
@@ -65,7 +65,7 @@ public Katze.Array? extension_init () {
 SListWebKit.WebPlugin plugins = pdb.get_plugins ();
 
 foreach (WebKit.WebPlugin plugin in plugins) {
-if (plugin.get_path () == null || npwrapper. in plugin.get_path () 
|| plugins-wrapped in plugin.get_path())
+if (Midori.WebSettings.skip_plugin (plugin.get_path ()))
 continue;
 extensions.add_item (new NSPlugins.Extension (plugin));
 }
diff --git a/midori/midori-view.c b/midori/midori-view.c
index 7350023..a9ac753 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -3919,12 +3919,23 @@ midori_view_list_versions (GString* markup,
 ));
 }
 
+#ifdef HAVE_WEBKIT2
+static void
+midori_view_get_plugins_cb (GObject*  object,
+GAsyncResult* result,
+MidoriView*   view)
+{
+GList* plugins = webkit_web_context_get_plugins_finish (WEBKIT_WEB_CONTEXT 
(object), result, NULL);
+g_object_set_data (object, nsplugins, plugins);
+midori_view_reload (view, FALSE);
+}
+#endif
+
 void
 midori_view_list_plugins (MidoriView* view,
   GString*ns_plugins,
   gbooleanhtml)
 {
-#ifndef HAVE_WEBKIT2
 if (!midori_web_settings_has_plugin_support ())
 return;
 
@@ -3933,14 +3944,29 @@ midori_view_list_plugins (MidoriView* view,
 else
 g_string_append_c (ns_plugins, '\n');
 
-#if WEBKIT_CHECK_VERSION (1, 3, 8)
+#ifdef HAVE_WEBKIT2
+WebKitWebContext* context = webkit_web_context_get_default ();
+GList* plugins = g_object_get_data (G_OBJECT (context), nsplugins);
+if (plugins == NULL)
+{
+midori_view_add_version (ns_plugins, html, g_strdup (…));
+webkit_web_context_get_plugins (context, NULL, 
(GAsyncReadyCallback)midori_view_get_plugins_cb, view);
+}
+else
+for (; plugins != NULL; plugins = g_list_next (plugins))
+{
+if (!midori_web_settings_skip_plugin (webkit_plugin_get_path 
(plugins-data)))
+midori_view_add_version (ns_plugins, html, g_strdup_printf 
(%s\t%s,
+webkit_plugin_get_name (plugins-data),
+html ? webkit_plugin_get_description (plugins-data) : 
));
+}
+#elif WEBKIT_CHECK_VERSION (1, 3, 8)
 WebKitWebPluginDatabase* pdb = webkit_get_web_plugin_database ();
 GSList* plugins = webkit_web_plugin_database_get_plugins (pdb);
 GSList* plugin = plugins;
 for (; plugin != NULL; plugin = g_slist_next (plugin))
 {
-const gchar* path = webkit_web_plugin_get_path (plugin-data);
-if (!path || strstr (path, npwrapper.) || strstr (path, 
plugins-wrapped))
+if (midori_web_settings_skip_plugin (webkit_web_plugin_get_path 
(plugin-data)))
 continue;
 midori_view_add_version (ns_plugins, html, g_strdup_printf (%s\t%s,
 webkit_web_plugin_get_name (plugin-data),
@@ -3965,9 +3991,8 @@ midori_view_list_plugins (MidoriView* view,
 while (items[i] != NULL)
 {
 gchar** parts = g_strsplit (items[i], |, 2);
-if (parts[0]
-  !strstr (parts[1], npwrapper.)  !strstr (parts[1], 
plugins-wrapped)
-  !g_str_equal (parts[1], undefined))
+if (parts[0]  !g_str_equal (parts[1], undefined)
+  !midori_web_settings_skip_plugin (parts[1]))
 midori_view_add_version (ns_plugins, html, g_strdup_printf 
(%s\t%s,
 parts[1], html ? parts[0] : ));
 g_strfreev (parts);
@@ -3979,9 +4004,6 @@ midori_view_list_plugins (MidoriView* view,
 g_strfreev (items);
 g_free (value);
 #endif
-#else
-return;
-#endif
 }
 
 static void
diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c
index 7f7385a..7bc820a 100644
--- a/midori/midori-websettings.c
+++ b/midori/midori-websettings.c
@@ -625,6 +625,19 @@ midori_web_settings_has_plugin_support (void)
 }
 
 /**
+ * midori_web_settings_skip_plugin:
+ *
+ * Returns: %TRUE if the passed plugin shouldn't be shown in UI 

[Xfce4-commits] midori:master Use default-charset in both WebKit 1/ 2

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to 431e1b48022d7bc6e1c687ae0ff33a40ec5ca074 (commit)
   from 0c0549f9efe0f00e3b3537b7a091ee36afeabf5a (commit)

commit 431e1b48022d7bc6e1c687ae0ff33a40ec5ca074
Author: Christian Dywan christ...@twotoasts.de
Date:   Thu Apr 4 23:34:29 2013 +0200

Use default-charset in both WebKit 1/ 2

 midori/midori-browser.c |   55 +--
 midori/midori-preferences.c |2 +-
 midori/midori-settings.vala |6 
 midori/midori-websettings.c |   20 
 4 files changed, 44 insertions(+), 39 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 3ceb8e3..30e814f 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -3453,34 +3453,33 @@ _action_view_encoding_activate (GtkAction* action,
 MidoriBrowser* browser)
 {
 GtkWidget* view = midori_browser_get_current_tab (browser);
-const gchar* name;
-GtkWidget* web_view;
+const gchar* name = gtk_action_get_name (current);
+WebKitWebView* web_view = WEBKIT_WEB_VIEW (midori_view_get_web_view 
(MIDORI_VIEW (view)));
 
-name = gtk_action_get_name (current);
-web_view = midori_view_get_web_view (MIDORI_VIEW (view));
-if (!strcmp (name, EncodingAutomatic))
-g_object_set (web_view, custom-encoding, NULL, NULL);
-else
-{
-const gchar* encoding;
-if (!strcmp (name, EncodingChinese))
-encoding = BIG5;
-else if (!strcmp (name, EncodingChineseSimplified))
-encoding = GB18030;
-else if (!strcmp (name, EncodingJapanese))
-encoding = SHIFT_JIS;
-else if (!strcmp (name, EncodingKorean))
-encoding = EUC-KR;
-else if (!strcmp (name, EncodingRussian))
-encoding = KOI8-R;
-else if (!strcmp (name, EncodingUnicode))
-encoding = UTF-8;
-else if (!strcmp (name, EncodingWestern))
-encoding = ISO-8859-1;
-else
-g_assert_not_reached ();
-g_object_set (web_view, custom-encoding, encoding, NULL);
-}
+const gchar* encoding;
+if (!strcmp (name, EncodingAutomatic))
+encoding = NULL;
+else if (!strcmp (name, EncodingChinese))
+encoding = BIG5;
+else if (!strcmp (name, EncodingChineseSimplified))
+encoding = GB18030;
+else if (!strcmp (name, EncodingJapanese))
+encoding = SHIFT_JIS;
+else if (!strcmp (name, EncodingKorean))
+encoding = EUC-KR;
+else if (!strcmp (name, EncodingRussian))
+encoding = KOI8-R;
+else if (!strcmp (name, EncodingUnicode))
+encoding = UTF-8;
+else if (!strcmp (name, EncodingWestern))
+encoding = ISO-8859-1;
+else
+g_assert_not_reached ();
+#ifdef HAVE_WEBKIT2
+webkit_web_view_set_custom_charset (web_view, encoding);
+#else
+webkit_web_view_set_custom_encoding (web_view, encoding);
+#endif
 }
 
 static void
diff --git a/midori/midori-preferences.c b/midori/midori-preferences.c
index 6415ac2..0e30835 100644
--- a/midori/midori-preferences.c
+++ b/midori/midori-preferences.c
@@ -355,7 +355,7 @@ midori_preferences_set_settings (MidoriPreferences* 
preferences,
 label = gtk_label_new (_(Preferred Encoding));
 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
 INDENTED_ADD (label);
-button = katze_property_proxy (settings, preferred-encoding, 
custom-default-encoding);
+button = katze_property_proxy (settings, preferred-encoding, 
custom-default-charset);
 SPANNED_ADD (button);
 
 /* Page Behavior */
diff --git a/midori/midori-settings.vala b/midori/midori-settings.vala
index 018d0e7..32e379d 100644
--- a/midori/midori-settings.vala
+++ b/midori/midori-settings.vala
@@ -27,6 +27,12 @@ namespace Midori {
 } set {
 enable_scripts = value;
 } }
+/* Since: 0.5.1 */
+public string default_charset { owned get {
+return default_encoding;
+} set {
+default_encoding = value;
+} }
 #else
 public class Settings : WebKit.Settings {
 #endif
diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c
index 7bc820a..bcc3c62 100644
--- a/midori/midori-websettings.c
+++ b/midori/midori-websettings.c
@@ -532,7 +532,7 @@ notify_default_encoding_cb (GObject*object,
 
 web_settings = MIDORI_WEB_SETTINGS (object);
 
-g_object_get (object, default-encoding, string, NULL);
+g_object_get (object, pspec-name, string, NULL);
 encoding = string ? string : ;
 if (!strcmp (encoding, BIG5))
 web_settings-preferred_encoding = MIDORI_ENCODING_CHINESE;
@@ -581,7 +581,7 @@ midori_web_settings_init (MidoriWebSettings* web_settings)
  * { -webkit-appearance: none !important });
 #endif
 
-g_signal_connect 

[Xfce4-commits] midori:master Implement URI prefetching for WebKit2

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to 489c3d951c41a12354c234c7b241d7a640dccc0d (commit)
   from 431e1b48022d7bc6e1c687ae0ff33a40ec5ca074 (commit)

commit 489c3d951c41a12354c234c7b241d7a640dccc0d
Author: Christian Dywan christ...@twotoasts.de
Date:   Thu Apr 4 23:42:04 2013 +0200

Implement URI prefetching for WebKit2

 midori/sokoke.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/midori/sokoke.c b/midori/sokoke.c
index bcc3c24..04940b3 100644
--- a/midori/sokoke.c
+++ b/midori/sokoke.c
@@ -977,6 +977,10 @@ sokoke_prefetch_uri (MidoriWebSettings*  settings,
 return FALSE;
 }
 
+#ifdef HAVE_WEBKIT2
+WebKitWebContext* context = webkit_web_context_get_default ();
+webkit_web_context_prefetch_dns (context, hostname);
+#else
 if (!hosts ||
 !g_regex_match_simple (hostname, hosts,
G_REGEX_CASELESS, G_REGEX_MATCH_NOTEMPTY))
@@ -997,15 +1001,11 @@ sokoke_prefetch_uri (MidoriWebSettings*  settings,
 new_hosts = g_strdup_printf (%s|%s, hosts, hostname);
 katze_assign (hosts, new_hosts);
 }
-#ifndef HAVE_WEBKIT2
 else if (callback)
 callback (NULL, SOUP_STATUS_OK, user_data);
+#endif
 g_free (hostname);
 return TRUE;
-#else
-g_free (hostname);
-return FALSE;
-#endif
 }
 
 /**
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] midori:master Implement Back and Forward actions in WebKit2

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to c32b685289661ae1b83355c566120e8bd3437240 (commit)
   from 489c3d951c41a12354c234c7b241d7a640dccc0d (commit)

commit c32b685289661ae1b83355c566120e8bd3437240
Author: Christian Dywan christ...@twotoasts.de
Date:   Thu Apr 4 23:47:37 2013 +0200

Implement Back and Forward actions in WebKit2

 midori/midori-browser.c |   43 ---
 1 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 30e814f..33a147b 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -3601,14 +3601,11 @@ static void
 _action_scroll_somewhere_activate (GtkAction* action,
MidoriBrowser* browser)
 {
-GtkWidget* view;
-WebKitWebView* web_view;
-const gchar* name;
-
-view = midori_browser_get_current_tab (browser);
-web_view = WEBKIT_WEB_VIEW (midori_view_get_web_view (MIDORI_VIEW (view)));
-name = gtk_action_get_name (action);
 #ifndef HAVE_WEBKIT2
+GtkWidget* view = midori_browser_get_current_tab (browser);
+WebKitWebView* web_view = WEBKIT_WEB_VIEW (midori_view_get_web_view 
(MIDORI_VIEW (view)));
+const gchar* name = gtk_action_get_name (action);
+
 if (g_str_equal (name, ScrollLeft))
 webkit_web_view_move_cursor (web_view, GTK_MOVEMENT_VISUAL_POSITIONS, 
-1);
 else if (g_str_equal (name, ScrollDown))
@@ -3670,7 +3667,6 @@ static gboolean
 _action_navigation_activate (GtkAction* action,
  MidoriBrowser* browser)
 {
-#ifndef HAVE_WEBKIT2
 MidoriView* view;
 GtkWidget* tab;
 gchar* uri;
@@ -3701,11 +3697,16 @@ _action_navigation_activate (GtkAction* action,
 {
 if (middle_click)
 {
-GtkWidget* web_view = midori_view_get_web_view (view);
-WebKitWebBackForwardList* back_forward_list =
-webkit_web_view_get_back_forward_list (WEBKIT_WEB_VIEW 
(web_view));
-WebKitWebHistoryItem* back_item = 
webkit_web_back_forward_list_get_back_item (back_forward_list);
-const gchar* back_uri = webkit_web_history_item_get_uri 
(back_item);
+WebKitWebView* web_view = WEBKIT_WEB_VIEW 
(midori_view_get_web_view (view));
+#ifdef HAVE_WEBKIT2
+WebKitBackForwardList* list = 
webkit_web_view_get_back_forward_list (web_view);
+WebKitBackForwardListItem* item = 
webkit_back_forward_list_get_back_item (list);
+const gchar* back_uri = webkit_back_forward_list_item_get_uri 
(item);
+#else
+WebKitWebBackForwardList* list = 
webkit_web_view_get_back_forward_list (web_view);
+WebKitWebHistoryItem* item = 
webkit_web_back_forward_list_get_forward_item (list);
+const gchar* back_uri = webkit_web_history_item_get_uri (item);
+#endif
 GtkWidget* view = midori_browser_add_uri (browser, back_uri);
 midori_browser_set_current_tab_smartly (browser, view);
 }
@@ -3718,11 +3719,16 @@ _action_navigation_activate (GtkAction* action,
 {
 if (middle_click)
 {
-GtkWidget* web_view = midori_view_get_web_view (view);
-WebKitWebBackForwardList* back_forward_list =
-webkit_web_view_get_back_forward_list (WEBKIT_WEB_VIEW 
(web_view));
-WebKitWebHistoryItem* forward_item = 
webkit_web_back_forward_list_get_forward_item (back_forward_list);
-const gchar* forward_uri = webkit_web_history_item_get_uri 
(forward_item);
+WebKitWebView* web_view = WEBKIT_WEB_VIEW 
(midori_view_get_web_view (view));
+#ifdef HAVE_WEBKIT2
+WebKitBackForwardList* list = 
webkit_web_view_get_back_forward_list (web_view);
+WebKitBackForwardListItem* item = 
webkit_back_forward_list_get_forward_item (list);
+const gchar* forward_uri = webkit_back_forward_list_item_get_uri 
(item);
+#else
+WebKitWebBackForwardList* list = 
webkit_web_view_get_back_forward_list (web_view);
+WebKitWebHistoryItem* item = 
webkit_web_back_forward_list_get_forward_item (list);
+const gchar* forward_uri = webkit_web_history_item_get_uri (item);
+#endif
 GtkWidget* view = midori_browser_add_uri (browser, forward_uri);
 midori_browser_set_current_tab_smartly (browser, view);
 }
@@ -3775,7 +3781,6 @@ _action_navigation_activate (GtkAction* action,
 
 return TRUE;
 }
-#endif
 return FALSE;
 }
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] midori:master There's no spell-checking-languages setting in WebKit2

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to b92a0df29f90dafa342832def455976d732531cc (commit)
   from 0f7baae1938a7d413ba77449f9d4b92844b98884 (commit)

commit b92a0df29f90dafa342832def455976d732531cc
Author: Christian Dywan christ...@twotoasts.de
Date:   Thu Apr 4 23:53:36 2013 +0200

There's no spell-checking-languages setting in WebKit2

 midori/midori-websettings.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c
index 985dc42..cd80bec 100644
--- a/midori/midori-websettings.c
+++ b/midori/midori-websettings.c
@@ -1048,8 +1048,10 @@ midori_web_settings_set_property (GObject*  object,
 break;
 case PROP_PREFERRED_LANGUAGES:
 katze_assign (web_settings-http_accept_language, g_value_dup_string 
(value));
+#ifndef HAVE_WEBKIT2
 g_object_set (web_settings, spell-checking-languages,
   web_settings-http_accept_language, NULL);
+#endif
 midori_web_settings_update_accept_language (web_settings);
 break;
 case PROP_SITE_DATA_RULES:
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] midori:master enable-java-applet becomes enable-java in WebKit2

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to 0f7baae1938a7d413ba77449f9d4b92844b98884 (commit)
   from c32b685289661ae1b83355c566120e8bd3437240 (commit)

commit 0f7baae1938a7d413ba77449f9d4b92844b98884
Author: Christian Dywan christ...@twotoasts.de
Date:   Thu Apr 4 23:53:11 2013 +0200

enable-java-applet becomes enable-java in WebKit2

 midori/midori-websettings.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c
index bcc3c62..985dc42 100644
--- a/midori/midori-websettings.c
+++ b/midori/midori-websettings.c
@@ -1009,7 +1009,9 @@ midori_web_settings_set_property (GObject*  object,
 case PROP_ENABLE_PLUGINS:
 g_object_set (web_settings,
WEB_SETTINGS_STRING (enable-plugins), g_value_get_boolean (value),
-#if WEBKIT_CHECK_VERSION (1, 1, 22)
+#if HAVE_WEBKIT2
+enable-java, g_value_get_boolean (value),
+#elif WEBKIT_CHECK_VERSION (1, 1, 22)
 enable-java-applet, g_value_get_boolean (value),
 #endif
 NULL);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] midori:master There's no user-stylesheet-uri in WebKit2

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to 13d67c47ae8a1adb3c98737daa3a65ce91a84245 (commit)
   from b92a0df29f90dafa342832def455976d732531cc (commit)

commit 13d67c47ae8a1adb3c98737daa3a65ce91a84245
Author: Christian Dywan christ...@twotoasts.de
Date:   Thu Apr 4 23:54:12 2013 +0200

There's no user-stylesheet-uri in WebKit2

 midori/midori-websettings.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c
index cd80bec..38aefeb 100644
--- a/midori/midori-websettings.c
+++ b/midori/midori-websettings.c
@@ -1222,8 +1222,12 @@ midori_web_settings_get_property (GObject*object,
 WEB_SETTINGS_STRING (enable-fullscreen)));
 break;
 case PROP_USER_STYLESHEET_URI:
+#ifdef HAVE_WEBKIT2
+g_value_set_string (value, web_settings-user_stylesheet_uri);
+#else
 g_value_take_string (value, katze_object_get_string (web_settings,
 WEB_SETTINGS_STRING (user-stylesheet-uri)));
+#endif
 break;
 default:
 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -1278,7 +1282,11 @@ midori_web_settings_process_stylesheets 
(MidoriWebSettings* settings,
 
 /* data: uri prefix from Source/WebCore/page/Page.cpp:700 in WebKit */
 encoded = g_strconcat (data:text/css;charset=utf-8;base64,, css-str, 
NULL);
+#ifdef HAVE_WEBKIT2
+/* TODO: webkit_web_view_group_add_user_style_sheet */
+#else
 g_object_set (settings, WEB_SETTINGS_STRING (user-stylesheet-uri), 
encoded, NULL);
+#endif
 g_free (encoded);
 g_string_free (css, TRUE);
 }
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] midori:master Implement zoom_text_and_images for WebKit2

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to 9295eb8efd7870fcec255ff7ba6df684bd150fe2 (commit)
   from 13d67c47ae8a1adb3c98737daa3a65ce91a84245 (commit)

commit 9295eb8efd7870fcec255ff7ba6df684bd150fe2
Author: Christian Dywan christ...@twotoasts.de
Date:   Fri Apr 5 00:38:16 2013 +0200

Implement zoom_text_and_images for WebKit2

 midori/midori-settings.vala |9 +++--
 midori/midori-view.c|   29 +
 2 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/midori/midori-settings.vala b/midori/midori-settings.vala
index 32e379d..946b72c 100644
--- a/midori/midori-settings.vala
+++ b/midori/midori-settings.vala
@@ -33,8 +33,15 @@ namespace Midori {
 } set {
 default_encoding = value;
 } }
+/* Since: 0.1.3 */
+public bool zoom_text_and_images { get; set; default = true; }
 #else
 public class Settings : WebKit.Settings {
+public bool zoom_text_and_images { get {
+return !zoom_text_only;
+} set {
+zoom_text_only = !value;
+} }
 #endif
 public bool remember_last_window_size { get; set; default = true; }
 public int last_window_width { get; set; default = 0; }
@@ -101,8 +108,6 @@ namespace Midori {
 public bool find_while_typing { get; set; default = false; }
 
 public bool open_popups_in_tabs { get; set; default = true; }
-/* Since: 0.1.3 */
-public bool zoom_text_and_images { get; set; default = true; }
 /* Since: 0.2.0 */
 // [Deprecated (since = 0.4.9)]
 public bool kinetic_scrolling { get; set; default = true; }
diff --git a/midori/midori-view.c b/midori/midori-view.c
index a9ac753..a3c497d 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -3432,10 +3432,11 @@ _midori_view_set_settings (MidoriView*view,
 open-tabs-in-the-background, view-open_tabs_in_the_background,
 NULL);
 
-g_object_set (view-web_view,
-  settings, settings,
-  full-content-zoom, zoom_text_and_images,
-  NULL);
+webkit_web_view_set_settings (WEBKIT_WEB_VIEW (view-web_view), 
(void*)settings);
+#ifndef HAVE_WEBKIT2
+webkit_web_view_set_full_content_zoom (WEBKIT_WEB_VIEW (view-web_view),
+zoom_text_and_images);
+#endif
 }
 
 /**
@@ -3506,12 +3507,16 @@ midori_view_settings_notify_cb (MidoriWebSettings* 
settings,
 g_value_init (value, pspec-value_type);
 g_object_get_property (G_OBJECT (view-settings), name, value);
 
-if (name == g_intern_string (zoom-text-and-images))
+if (name == g_intern_string (open-new-pages-in))
+view-open_new_pages_in = g_value_get_enum (value);
+#ifndef HAVE_WEBKIT2
+else if (name == g_intern_string (zoom-text-and-images))
 {
 if (view-web_view)
-g_object_set (view-web_view, full-content-zoom,
-  g_value_get_boolean (value), NULL);
+webkit_web_view_set_full_content_zoom (WEBKIT_WEB_VIEW 
(view-web_view),
+g_value_get_boolean (value));
 }
+#endif
 else if (name == g_intern_string (close-buttons-on-tabs))
 {
 view-close_buttons_on_tabs = g_value_get_boolean (value);
@@ -3520,8 +3525,6 @@ midori_view_settings_notify_cb (MidoriWebSettings* 
settings,
view-close_buttons_on_tabs);
 #endif
 }
-else if (name == g_intern_string (open-new-pages-in))
-view-open_new_pages_in = g_value_get_enum (value);
 else if (name == g_intern_string (middle-click-opens-selection))
 view-middle_click_opens_selection = g_value_get_boolean (value);
 else if (name == g_intern_string (open-tabs-in-the-background))
@@ -3807,9 +3810,11 @@ midori_view_constructor (GType  type,
 
 if (view-settings)
 {
-g_object_set (view-web_view, settings, view-settings,
-full-content-zoom, katze_object_get_boolean (view-settings,
-zoom-text-and-images), NULL);
+webkit_web_view_set_settings (WEBKIT_WEB_VIEW (view-web_view), 
(void*)view-settings);
+#ifndef HAVE_WEBKIT2
+webkit_web_view_set_full_content_zoom (WEBKIT_WEB_VIEW 
(view-web_view),
+katze_object_get_boolean (view-settings, zoom-text-and-images));
+#endif
 }
 
 #ifdef HAVE_WEBKIT2
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] midori:master Deprecate middle_click_opens_selection in favour of gtk-enable-primary-paste

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to 2673578d883029dbb13700df99d71b2167df1de6 (commit)
   from 9295eb8efd7870fcec255ff7ba6df684bd150fe2 (commit)

commit 2673578d883029dbb13700df99d71b2167df1de6
Author: Christian Dywan christ...@twotoasts.de
Date:   Fri Apr 5 00:46:03 2013 +0200

Deprecate middle_click_opens_selection in favour of gtk-enable-primary-paste

 midori/midori-settings.vala |1 +
 midori/midori-view.c|   10 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/midori/midori-settings.vala b/midori/midori-settings.vala
index 946b72c..75c68f3 100644
--- a/midori/midori-settings.vala
+++ b/midori/midori-settings.vala
@@ -111,6 +111,7 @@ namespace Midori {
 /* Since: 0.2.0 */
 // [Deprecated (since = 0.4.9)]
 public bool kinetic_scrolling { get; set; default = true; }
+// [Deprecated (since = 0.5.0)]
 public bool middle_click_opens_selection { get; set; default = true; }
 public bool flash_window_on_new_bg_tabs { get; set; default = false; }
 
diff --git a/midori/midori-view.c b/midori/midori-view.c
index a3c497d..b4d2d30 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -104,7 +104,6 @@ struct _MidoriView
 GtkWidget* web_view;
 KatzeArray* news_feeds;
 
-gboolean middle_click_opens_selection;
 gboolean open_tabs_in_the_background;
 gboolean close_buttons_on_tabs;
 MidoriNewPage open_new_pages_in;
@@ -1760,7 +1759,11 @@ midori_view_web_view_button_press_event_cb 
(WebKitWebView*  web_view,
 view-button_press_handled = TRUE;
 return TRUE;
 }
-if (view-middle_click_opens_selection)
+#if GTK_CHECK_VERSION (3, 4, 0)
+if (katze_object_get_boolean (gtk_widget_get_settings 
(view-web_view), gtk-enable-primary-paste))
+#else
+if (midori_settings_get_middle_click_opens_selection (MIDORI_SETTINGS 
(view-settings)))
+#endif
 {
 gboolean is_editable;
 WebKitHitTestResult* result;
@@ -3428,7 +3431,6 @@ _midori_view_set_settings (MidoriView*view,
 zoom-text-and-images, zoom_text_and_images,
 close-buttons-on-tabs, view-close_buttons_on_tabs,
 open-new-pages-in, view-open_new_pages_in,
-middle-click-opens-selection, view-middle_click_opens_selection,
 open-tabs-in-the-background, view-open_tabs_in_the_background,
 NULL);
 
@@ -3525,8 +3527,6 @@ midori_view_settings_notify_cb (MidoriWebSettings* 
settings,
view-close_buttons_on_tabs);
 #endif
 }
-else if (name == g_intern_string (middle-click-opens-selection))
-view-middle_click_opens_selection = g_value_get_boolean (value);
 else if (name == g_intern_string (open-tabs-in-the-background))
 view-open_tabs_in_the_background = g_value_get_boolean (value);
 else if (name == g_intern_string (enable-javascript))
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] midori:master Implement res:// and stock:// in WebKit2

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to f33299b41b0fd3f7aa5cb1edd7c6e65a960907b7 (commit)
   from 2673578d883029dbb13700df99d71b2167df1de6 (commit)

commit f33299b41b0fd3f7aa5cb1edd7c6e65a960907b7
Author: Christian Dywan christ...@twotoasts.de
Date:   Fri Apr 5 00:56:40 2013 +0200

Implement res:// and stock:// in WebKit2

 midori/midori-view.c |   57 ++---
 1 files changed, 53 insertions(+), 4 deletions(-)

diff --git a/midori/midori-view.c b/midori/midori-view.c
index b4d2d30..336d42c 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -74,6 +74,12 @@ midori_view_web_view_get_snapshot (GtkWidget* web_view,
gint   width,
gint   height);
 
+#ifdef HAVE_WEBKIT2
+static void
+midori_view_uri_scheme_res (WebKitURISchemeRequest* request,
+gpointeruser_data);
+#endif
+
 static gboolean
 midori_view_display_error (MidoriView* view,
const gchar*uri,
@@ -383,6 +389,14 @@ midori_view_class_init (MidoriViewClass* class)
  The associated settings,
  MIDORI_TYPE_WEB_SETTINGS,
  G_PARAM_READWRITE | 
G_PARAM_STATIC_STRINGS));
+
+#ifdef HAVE_WEBKIT2
+WebKitWebContext* context = webkit_web_context_get_default ();
+webkit_web_context_register_uri_scheme (context,
+res, midori_view_uri_scheme_res, NULL, NULL);
+webkit_web_context_register_uri_scheme (context,
+stock, midori_view_uri_scheme_res, NULL, NULL);
+#endif
 }
 
 static void
@@ -922,7 +936,15 @@ webkit_web_view_progress_changed_cb (WebKitWebView* 
web_view,
 midori_tab_set_progress (MIDORI_TAB (view), progress);
 }
 
-#ifndef HAVE_WEBKIT2
+#ifdef HAVE_WEBKIT2
+static void
+midori_view_uri_scheme_res (WebKitURISchemeRequest* request,
+gpointeruser_data)
+{
+const gchar* uri = webkit_uri_scheme_request_get_uri (request);
+WebKitWebView* web_view = webkit_uri_scheme_request_get_web_view (request);
+MidoriView* view = midori_view_get_for_widget (GTK_WIDGET (web_view));
+#else
 static void
 midori_view_web_view_resource_request_cb (WebKitWebView* web_view,
   WebKitWebFrame*web_frame,
@@ -932,6 +954,7 @@ midori_view_web_view_resource_request_cb (WebKitWebView*
 web_view,
   MidoriView*view)
 {
 const gchar* uri = webkit_network_request_get_uri (request);
+#endif
 
 /* Only apply custom URIs to special pages for security purposes */
 if (!midori_tab_get_special (MIDORI_TAB (view)))
@@ -940,10 +963,25 @@ midori_view_web_view_resource_request_cb (WebKitWebView*  
   web_view,
 if (g_str_has_prefix (uri, res://))
 {
 gchar* filepath = midori_paths_get_res_filename (uri[6]);
+#ifdef HAVE_WEBKIT2
+gchar* contents;
+gsize length;
+if (g_file_get_contents (filepath, contents, length, NULL))
+{
+gchar* content_type = g_content_type_guess (filepath, 
(guchar*)contents, length, NULL);
+gchar* mime_type = g_content_type_get_mime_type (content_type);
+GInputStream* stream = g_memory_input_stream_new_from_data 
(contents, -1, g_free);
+webkit_uri_scheme_request_finish (request, stream, -1, mime_type);
+g_object_unref (stream);
+g_free (mime_type);
+g_free (content_type);
+}
+#else
 gchar* file_uri = g_filename_to_uri (filepath, NULL, NULL);
-g_free (filepath);
 webkit_network_request_set_uri (request, file_uri);
 g_free (file_uri);
+#endif
+g_free (filepath);
 }
 else if (g_str_has_prefix (uri, stock://))
 {
@@ -992,12 +1030,18 @@ midori_view_web_view_resource_request_cb (WebKitWebView* 
web_view,
 gsize buffer_size;
 if (g_file_get_contents (icon_filename, buffer, buffer_size, 
NULL))
 {
+#ifdef HAVE_WEBKIT2
+GInputStream* stream = g_memory_input_stream_new_from_data 
(buffer, buffer_size, g_free);
+webkit_uri_scheme_request_finish (request, stream, -1, 
image/svg+xml);
+g_object_unref (stream);
+#else
 gchar* encoded = g_base64_encode ((guchar*)buffer, 
buffer_size);
 gchar* data_uri = g_strconcat (data:image/svg+xml;base64,, 
encoded, NULL);
 g_free (buffer);
 g_free (encoded);
 webkit_network_request_set_uri (request, data_uri);
 g_free (data_uri);
+#endif
 return;
 }
 }
@@ -1021,16 +1065,21 @@ midori_view_web_view_resource_request_cb 

[Xfce4-commits] midori:master Implement navigation policy in WebKit2

2013-04-04 Thread Christian Dywan
Updating branch refs/heads/master
 to 8d041d8a30fd40a70627fe806a42930c1a93f5f9 (commit)
   from f33299b41b0fd3f7aa5cb1edd7c6e65a960907b7 (commit)

commit 8d041d8a30fd40a70627fe806a42930c1a93f5f9
Author: Christian Dywan christ...@twotoasts.de
Date:   Fri Apr 5 01:12:17 2013 +0200

Implement navigation policy in WebKit2

 midori/midori-view.c |   31 ---
 1 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/midori/midori-view.c b/midori/midori-view.c
index 336d42c..7fa0165 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -711,18 +711,24 @@ midori_view_update_load_status (MidoriView*  view,
 #endif
 }
 
-#ifndef HAVE_WEBKIT2
 static gboolean
 midori_view_web_view_navigation_decision_cb (WebKitWebView* 
web_view,
+ #ifdef HAVE_WEBKIT2
+ WebKitPolicyDecision*  
decision,
+ WebKitPolicyDecisionType   
decision_type,
+ #else
  WebKitWebFrame*
web_frame,
  WebKitNetworkRequest*  
request,
  WebKitWebNavigationAction* action,
  WebKitWebPolicyDecision*   
decision,
+ #endif
  MidoriView*view)
 {
-JSContextRef js_context;
-gchar* result;
+#ifdef HAVE_WEBKIT2
+const gchar* uri = webkit_web_view_get_uri (web_view);
+#else
 const gchar* uri = webkit_network_request_get_uri (request);
+#endif
 if (g_str_has_prefix (uri, geo:)  strstr (uri, ,))
 {
 gchar* new_uri = sokoke_magic_uri (uri, TRUE, FALSE);
@@ -735,7 +741,11 @@ midori_view_web_view_navigation_decision_cb 
(WebKitWebView* web_view
 if (sokoke_show_uri (gtk_widget_get_screen (GTK_WIDGET (web_view)),
  uri, GDK_CURRENT_TIME, NULL))
 {
+#ifdef HAVE_WEBKIT2
+webkit_policy_decision_ignore (decision);
+#else
 webkit_web_policy_decision_ignore (decision);
+#endif
 return TRUE;
 }
 }
@@ -743,10 +753,14 @@ midori_view_web_view_navigation_decision_cb 
(WebKitWebView* web_view
 {
 /* For security reasons, main content served as data: is limited to 
images
http://lcamtuf.coredump.cx/switch/ */
+#ifdef HAVE_WEBKIT2
+webkit_policy_decision_ignore (decision);
+#else
 webkit_web_policy_decision_ignore (decision);
+#endif
 return TRUE;
 }
-#ifdef HAVE_GCR
+#if defined (HAVE_GCR)  !defined (HAVE_WEBKIT2)
 else if (/* midori_tab_get_special (MIDORI_TAB (view))  */ !strncmp 
(uri, https, 5))
 {
 /* We show an error page if the certificate is invalid.
@@ -800,9 +814,10 @@ midori_view_web_view_navigation_decision_cb 
(WebKitWebView* web_view
 katze_item_set_meta_integer (view-item, delay, 
MIDORI_DELAY_UNDELAYED);
 }
 
+#ifndef HAVE_WEBKIT2
 /* Remove link labels */
-js_context = webkit_web_frame_get_global_context (web_frame);
-result = sokoke_js_script_eval (js_context,
+JSContextRef js_context = webkit_web_frame_get_global_context (web_frame);
+gchar* result = sokoke_js_script_eval (js_context,
 (function (links) {
 if (links != undefined  links.length  0) {
for (var i = links.length - 1; i = 0; i--) {
@@ -821,9 +836,9 @@ midori_view_web_view_navigation_decision_cb (WebKitWebView* 
web_view
 NULL);
 g_free (result);
 view-find_links = -1;
+#endif
 return FALSE;
 }
-#endif
 
 static void
 midori_view_load_started (MidoriView* view)
@@ -3798,6 +3813,8 @@ midori_view_constructor (GType  type,
   midori_web_view_notify_icon_uri_cb, view,
   signal::mouse-target-changed,
   webkit_web_view_hovering_over_link_cb, view,
+  signal::decide-policy,
+  midori_view_web_view_navigation_decision_cb, view,
   #else
   signal::notify::load-status,
   midori_view_web_view_notify_load_status_cb, view,
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-indicator-plugin:master Updated list of files for translation

2013-04-04 Thread Andrzej
Updating branch refs/heads/master
 to 7f332e0fcedb818a5adfa497dcba1a3ffb272d8e (commit)
   from a7ae93ad809b386634f84e11c6ef1bea0eb3b6ca (commit)

commit 7f332e0fcedb818a5adfa497dcba1a3ffb272d8e
Author: Andrzej ndrwr...@gmail.com
Date:   Fri Apr 5 01:12:20 2013 +0100

Updated list of files for translation

 po/POTFILES.in |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/po/POTFILES.in b/po/POTFILES.in
index 24ff214..b800280 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,2 +1,7 @@
+panel-plugin/indicator.desktop.in
 panel-plugin/indicator.c
-panel-plugin/indicator.desktop.in.in
+panel-plugin/indicator-box.c
+panel-plugin/indicator-button.c
+panel-plugin/indicator-config.c
+panel-plugin/indicator-dialog.c
+panel-plugin/indicator-dialog.glade
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits