YaST Commits
Threads by month
- ----- 2025 -----
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
January 2012
- 18 participants
- 265 discussions
[yast-commit] r67146 - /branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/complex.ycp
by gs@svn2.opensuse.org 11 Jan '12
by gs@svn2.opensuse.org 11 Jan '12
11 Jan '12
Author: gs
Date: Wed Jan 11 14:26:08 2012
New Revision: 67146
URL: http://svn.opensuse.org/viewcvs/yast?rev=67146&view=rev
Log:
don't stop services if start on boot is enabled
Modified:
branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/complex.ycp
Modified: branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/fcoe-…
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/complex.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/complex.ycp Wed Jan 11 14:26:08 2012
@@ -55,11 +55,11 @@
y2milestone( "Aborting FCoE configuration" );
// revert start of 'fcoe' or 'lldpad'
- if ( FcoeClient::fcoe_started )
+ if ( FcoeClient::fcoe_started && !Service::Enabled( "boot.fcoe" ) )
{
Service::Stop( "boot.fcoe" );
}
- if ( FcoeClient::lldpad_started )
+ if ( FcoeClient::lldpad_started && !Service::Enabled( "boot.lldpad" ) )
{
Service::Stop( "boot.lldpad" );
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r67145 - /branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/FcoeClient.ycp
by gs@svn2.opensuse.org 11 Jan '12
by gs@svn2.opensuse.org 11 Jan '12
11 Jan '12
Author: gs
Date: Wed Jan 11 14:25:43 2012
New Revision: 67145
URL: http://svn.opensuse.org/viewcvs/yast?rev=67145&view=rev
Log:
add option -u to fipvlan (let interfaces up),
workaround for service start in installed system
Modified:
branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/FcoeClient.ycp
Modified: branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/FcoeClient.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/fcoe-…
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/FcoeClient.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/FcoeClient.ycp Wed Jan 11 14:25:43 2012
@@ -288,7 +288,9 @@
//
global map GetVlanInterfaces( list net_devices )
{
- string vlan_cmd = "LANG=POSIX fipvlan";
+ // Add option -u (or --link_up): don't shut down interfaces
+ // to be able to detect DCB state afterwards (see bnc #737683)
+ string vlan_cmd = "LANG=POSIX fipvlan -u";
map vlan_info = $[];
foreach ( string dev, (list<string>)net_devices, {
@@ -583,6 +585,8 @@
//
global boolean ServiceStatus()
{
+ boolean success = true;
+
// Loading of modules in Stage::initial() is not required (like in IsciClientLib.ycp, line 523 )
// see /etc/init.d/fcoe, line 85 (modprobe fcoe > /dev/null 2>&1)
boolean ret = true;
@@ -590,7 +594,7 @@
// first start lldpad
if ( Service::Status( "boot.lldpad" ) != 0 )
{
- boolean success = Service::Start( "boot.lldpad" );
+ success = Service::Start( "boot.lldpad" );
if ( success )
{
y2milestone( "Lldpad started (/etc/init.d/boot.lldpad start)");
@@ -609,9 +613,14 @@
y2milestone( "Lldpad service is running");
}
- if ( Service::Status( "boot.fcoe" ) != 0 )
+ if ( Service::Status( "boot.fcoe" ) != 0 )
{
- boolean success = Service::Start( "boot.fcoe" );
+ // workaround for installed system (see bnc #737798)
+ if ( Stage::normal() )
+ success = Service::Restart( "boot.fcoe" );
+ else
+ success = Service::Start( "boot.fcoe" );
+
if ( success )
{
y2milestone( "FCoE started (/etc/init.d/boot.fcoe start)");
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r67144 - in /trunk/ncurses: COPYING.GPL2 yast2-ncurses.spec.in
by gs@svn2.opensuse.org 11 Jan '12
by gs@svn2.opensuse.org 11 Jan '12
11 Jan '12
Author: gs
Date: Wed Jan 11 12:42:22 2012
New Revision: 67144
URL: http://svn.opensuse.org/viewcvs/yast?rev=67144&view=rev
Log:
COPYING.GPL2 not needed here, COPYING file is added
from devtools
Removed:
trunk/ncurses/COPYING.GPL2
Modified:
trunk/ncurses/yast2-ncurses.spec.in
Modified: trunk/ncurses/yast2-ncurses.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/yast2-ncurses.spec.in?re…
==============================================================================
--- trunk/ncurses/yast2-ncurses.spec.in (original)
+++ trunk/ncurses/yast2-ncurses.spec.in Wed Jan 11 12:42:22 2012
@@ -47,4 +47,7 @@
%dir @includedir@
@includedir@/ncurses/
%doc @docdir@
-%doc COPYING.GPL2
+%doc COPYING
+
+%changelog
+
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r67143 - in /trunk/control-center-gnome: ./ src/ src/cut-n-paste/ src/cut-n-paste/libgnome-control-center/ src/cut-n-paste/shell/ src/patch/
by vuntz@svn2.opensuse.org 11 Jan '12
by vuntz@svn2.opensuse.org 11 Jan '12
11 Jan '12
Author: vuntz
Date: Wed Jan 11 12:02:37 2012
New Revision: 67143
URL: http://svn.opensuse.org/viewcvs/yast?rev=67143&view=rev
Log:
2012-01-11 Vincent Untz <vuntz(a)gnome.org>
Release 2.21.3
Update to gnome-control-center code as of today. This reduces our patch
since many non-yast related changes are upstream now.
* VERSION: bump version.
* configure.in.in: we require glib >= 2.31.0
* src/cut-n-paste/: update code from gnome-control-center.
* src/{control-center.c,gnome-control-center.c,shell.ui}: rebase on
updated code.
* src/patch/: update patch to current changes.
Added:
trunk/control-center-gnome/src/cut-n-paste/shell/cc-editable-entry.c
trunk/control-center-gnome/src/cut-n-paste/shell/cc-editable-entry.h
trunk/control-center-gnome/src/cut-n-paste/shell/cc-panel.c
trunk/control-center-gnome/src/cut-n-paste/shell/cc-panel.h
trunk/control-center-gnome/src/cut-n-paste/shell/cc-shell.c
trunk/control-center-gnome/src/cut-n-paste/shell/cc-shell.h
Removed:
trunk/control-center-gnome/src/cut-n-paste/libgnome-control-center/
trunk/control-center-gnome/src/shell-search-renderer.c
Modified:
trunk/control-center-gnome/ChangeLog
trunk/control-center-gnome/VERSION
trunk/control-center-gnome/configure.in.in
trunk/control-center-gnome/src/Makefile.am
trunk/control-center-gnome/src/control-center.c
trunk/control-center-gnome/src/cut-n-paste/Makefile.am
trunk/control-center-gnome/src/cut-n-paste/shell/Makefile.am
trunk/control-center-gnome/src/cut-n-paste/shell/cc-shell-category-view.c
trunk/control-center-gnome/src/cut-n-paste/shell/cc-shell-model.c
trunk/control-center-gnome/src/cut-n-paste/shell/control-center.c
trunk/control-center-gnome/src/cut-n-paste/shell/gnome-control-center.c
trunk/control-center-gnome/src/cut-n-paste/shell/gnome-control-center.h
trunk/control-center-gnome/src/cut-n-paste/shell/shell-search-renderer.c
trunk/control-center-gnome/src/cut-n-paste/shell/shell.ui
trunk/control-center-gnome/src/gnome-control-center.c
trunk/control-center-gnome/src/patch/gnome-control-center.patch
trunk/control-center-gnome/src/patch/update-patch.sh
trunk/control-center-gnome/src/shell.ui
Modified: trunk/control-center-gnome/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/ChangeLog?r…
==============================================================================
--- trunk/control-center-gnome/ChangeLog (original)
+++ trunk/control-center-gnome/ChangeLog Wed Jan 11 12:02:37 2012
@@ -1,3 +1,17 @@
+2012-01-11 Vincent Untz <vuntz(a)gnome.org>
+
+ Release 2.21.3
+
+ Update to gnome-control-center code as of today. This reduces our patch
+ since many non-yast related changes are upstream now.
+
+ * VERSION: bump version.
+ * configure.in.in: we require glib >= 2.31.0
+ * src/cut-n-paste/: update code from gnome-control-center.
+ * src/{control-center.c,gnome-control-center.c,shell.ui}: rebase on
+ updated code.
+ * src/patch/: update patch to current changes.
+
2011-09-02 Vincent Untz <vuntz(a)gnome.org>
Release 2.21.2
Modified: trunk/control-center-gnome/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/VERSION?rev…
==============================================================================
--- trunk/control-center-gnome/VERSION (original)
+++ trunk/control-center-gnome/VERSION Wed Jan 11 12:02:37 2012
@@ -1 +1 @@
-2.21.2
+2.21.3
Modified: trunk/control-center-gnome/configure.in.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/configure.i…
==============================================================================
--- trunk/control-center-gnome/configure.in.in (original)
+++ trunk/control-center-gnome/configure.in.in Wed Jan 11 12:02:37 2012
@@ -19,7 +19,7 @@
AC_SUBST(GLIB_GENMARSHAL)
-PKG_CHECK_MODULES(CONTROL, gtk+-3.0 libgnome-menu-3.0 gio-unix-2.0)
+PKG_CHECK_MODULES(CONTROL, gtk+-3.0 libgnome-menu-3.0 gio-unix-2.0 glib-2.0 >= 2.31.0)
AC_SUBST(CONTROL_CFLAGS)
AC_SUBST(CONTROL_LIBS)
Modified: trunk/control-center-gnome/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/Makefil…
==============================================================================
--- trunk/control-center-gnome/src/Makefile.am (original)
+++ trunk/control-center-gnome/src/Makefile.am Wed Jan 11 12:02:37 2012
@@ -3,7 +3,6 @@
INCLUDES = \
$(CONTROL_CFLAGS) \
-I$(srcdir)/cut-n-paste \
- -I$(srcdir)/cut-n-paste/libgnome-control-center \
-I$(srcdir)/cut-n-paste/shell \
-I$(top_builddir)/src/cut-n-paste/shell
@@ -18,11 +17,9 @@
y2controlcenter_gnome_SOURCES = \
control-center.c \
- gnome-control-center.c \
- shell-search-renderer.c
+ gnome-control-center.c
y2controlcenter_gnome_LDADD = \
- $(top_builddir)/src/cut-n-paste/libgnome-control-center/libgnome-control-center.la \
$(top_builddir)/src/cut-n-paste/shell/libshell-unpatched.la \
$(CONTROL_LIBS)
Modified: trunk/control-center-gnome/src/control-center.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/control…
==============================================================================
--- trunk/control-center-gnome/src/control-center.c (original)
+++ trunk/control-center-gnome/src/control-center.c Wed Jan 11 12:02:37 2012
@@ -140,7 +140,12 @@
start_id = start_panels[0];
- if (!cc_shell_set_active_panel_from_id (CC_SHELL (shell), start_id, &err))
+ if (start_panels[1])
+ g_debug ("Extra argument: %s", start_panels[1]);
+ else
+ g_debug ("No extra argument");
+
+ if (!cc_shell_set_active_panel_from_id (CC_SHELL (shell), start_id, (const gchar**)start_panels+1, &err))
{
g_warning ("Could not load setting panel \"%s\": %s", start_id,
(err) ? err->message : "Unknown error");
@@ -192,8 +197,6 @@
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
-
- g_thread_init (NULL);
gtk_init (&argc, &argv);
cc_shell_log_init ();
Modified: trunk/control-center-gnome/src/cut-n-paste/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cut-n-p…
==============================================================================
--- trunk/control-center-gnome/src/cut-n-paste/Makefile.am (original)
+++ trunk/control-center-gnome/src/cut-n-paste/Makefile.am Wed Jan 11 12:02:37 2012
@@ -1 +1 @@
-SUBDIRS = libgnome-control-center shell
+SUBDIRS = shell
Modified: trunk/control-center-gnome/src/cut-n-paste/shell/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cut-n-p…
==============================================================================
--- trunk/control-center-gnome/src/cut-n-paste/shell/Makefile.am (original)
+++ trunk/control-center-gnome/src/cut-n-paste/shell/Makefile.am Wed Jan 11 12:02:37 2012
@@ -2,8 +2,7 @@
INCLUDES = \
$(CONTROL_CFLAGS) \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/cut-n-paste/libgnome-control-center
+ -I$(top_srcdir)/src
MARSHAL_FILES = cc-shell-marshal.c cc-shell-marshal.h
BUILT_SOURCES = $(MARSHAL_FILES)
@@ -18,6 +17,7 @@
cc-shell-log.c \
cc-shell-log.h \
gnome-control-center.h \
+ shell-search-renderer.c \
shell-search-renderer.h \
cc-shell-category-view.c \
cc-shell-category-view.h \
@@ -25,6 +25,12 @@
cc-shell-item-view.h \
cc-shell-model.c \
cc-shell-model.h \
+ cc-editable-entry.c \
+ cc-editable-entry.h \
+ cc-panel.c \
+ cc-panel.h \
+ cc-shell.c \
+ cc-shell.h \
$(MARSHAL_FILES)
EXTRA_DIST = \
Added: trunk/control-center-gnome/src/cut-n-paste/shell/cc-editable-entry.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cut-n-p…
==============================================================================
--- trunk/control-center-gnome/src/cut-n-paste/shell/cc-editable-entry.c (added)
+++ trunk/control-center-gnome/src/cut-n-paste/shell/cc-editable-entry.c Wed Jan 11 12:02:37 2012
@@ -0,0 +1,546 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright 2009-2010 Red Hat, Inc,
+ *
+ * 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 3 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 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.
+ *
+ * Written by: Matthias Clasen <mclasen(a)redhat.com>
+ */
+
+#include <gdk/gdkkeysyms.h>
+#include "cc-editable-entry.h"
+
+#define EMPTY_TEXT "\xe2\x80\x94"
+
+struct _CcEditableEntryPrivate {
+ GtkNotebook *notebook;
+ GtkLabel *label;
+ GtkButton *button;
+ GtkEntry *entry;
+
+ gchar *text;
+ gboolean editable;
+ gboolean selectable;
+ gint weight;
+ gboolean weight_set;
+ gdouble scale;
+ gboolean scale_set;
+
+ gboolean in_stop_editing;
+};
+
+#define CC_EDITABLE_ENTRY_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CC_TYPE_EDITABLE_ENTRY, CcEditableEntryPrivate))
+
+enum {
+ PROP_0,
+ PROP_TEXT,
+ PROP_EDITABLE,
+ PROP_SELECTABLE,
+ PROP_SCALE,
+ PROP_SCALE_SET,
+ PROP_WEIGHT,
+ PROP_WEIGHT_SET
+};
+
+enum {
+ EDITING_DONE,
+ LAST_SIGNAL
+};
+
+enum {
+ PAGE_LABEL,
+ PAGE_BUTTON,
+ PAGE_ENTRY
+};
+
+static guint signals [LAST_SIGNAL] = { 0, };
+
+G_DEFINE_TYPE (CcEditableEntry, cc_editable_entry, GTK_TYPE_ALIGNMENT);
+
+void
+cc_editable_entry_set_text (CcEditableEntry *e,
+ const gchar *text)
+{
+ CcEditableEntryPrivate *priv;
+ gchar *tmp;
+ GtkWidget *label;
+
+ priv = e->priv;
+
+ tmp = g_strdup (text);
+ g_free (priv->text);
+ priv->text = tmp;
+
+ gtk_entry_set_text (priv->entry, tmp);
+
+ if (tmp == NULL || tmp[0] == '\0')
+ tmp = EMPTY_TEXT;
+
+ gtk_label_set_text (priv->label, tmp);
+ label = gtk_bin_get_child (GTK_BIN (priv->button));
+ gtk_label_set_text (GTK_LABEL (label), tmp);
+
+ g_object_notify (G_OBJECT (e), "text");
+}
+
+const gchar *
+cc_editable_entry_get_text (CcEditableEntry *e)
+{
+ return e->priv->text;
+}
+
+void
+cc_editable_entry_set_editable (CcEditableEntry *e,
+ gboolean editable)
+{
+ CcEditableEntryPrivate *priv;
+
+ priv = e->priv;
+
+ if (priv->editable != editable) {
+ priv->editable = editable;
+
+ gtk_notebook_set_current_page (priv->notebook, editable ? PAGE_BUTTON : PAGE_LABEL);
+
+ g_object_notify (G_OBJECT (e), "editable");
+ }
+}
+
+gboolean
+cc_editable_entry_get_editable (CcEditableEntry *e)
+{
+ return e->priv->editable;
+}
+
+void
+cc_editable_entry_set_selectable (CcEditableEntry *e,
+ gboolean selectable)
+{
+ CcEditableEntryPrivate *priv;
+
+ priv = e->priv;
+
+ if (priv->selectable != selectable) {
+ priv->selectable = selectable;
+
+ gtk_label_set_selectable (priv->label, selectable);
+
+ g_object_notify (G_OBJECT (e), "selectable");
+ }
+}
+
+gboolean
+cc_editable_entry_get_selectable (CcEditableEntry *e)
+{
+ return e->priv->selectable;
+}
+
+static void
+update_entry_font (GtkWidget *widget,
+ CcEditableEntry *e)
+{
+ CcEditableEntryPrivate *priv = e->priv;
+ PangoFontDescription *desc;
+ GtkStyleContext *style;
+ gint size;
+
+ if (!priv->weight_set && !priv->scale_set)
+ return;
+
+ g_signal_handlers_block_by_func (widget, update_entry_font, e);
+
+ gtk_widget_override_font (widget, NULL);
+
+ style = gtk_widget_get_style_context (widget);
+ desc = pango_font_description_copy
+ (gtk_style_context_get_font (style, gtk_widget_get_state_flags (widget)));
+
+ if (priv->weight_set)
+ pango_font_description_set_weight (desc, priv->weight);
+ if (priv->scale_set) {
+ size = pango_font_description_get_size (desc);
+ pango_font_description_set_size (desc, priv->scale * size);
+ }
+ gtk_widget_override_font (widget, desc);
+
+ pango_font_description_free (desc);
+
+ g_signal_handlers_unblock_by_func (widget, update_entry_font, e);
+}
+
+static void
+update_fonts (CcEditableEntry *e)
+{
+ PangoAttrList *attrs;
+ PangoAttribute *attr;
+ GtkWidget *label;
+
+ CcEditableEntryPrivate *priv = e->priv;
+
+ attrs = pango_attr_list_new ();
+ if (priv->scale_set) {
+ attr = pango_attr_scale_new (priv->scale);
+ pango_attr_list_insert (attrs, attr);
+ }
+ if (priv->weight_set) {
+ attr = pango_attr_weight_new (priv->weight);
+ pango_attr_list_insert (attrs, attr);
+ }
+
+ gtk_label_set_attributes (priv->label, attrs);
+
+ label = gtk_bin_get_child (GTK_BIN (priv->button));
+ gtk_label_set_attributes (GTK_LABEL (label), attrs);
+
+ pango_attr_list_unref (attrs);
+
+ update_entry_font ((GtkWidget *)priv->entry, e);
+}
+
+void
+cc_editable_entry_set_weight (CcEditableEntry *e,
+ gint weight)
+{
+ CcEditableEntryPrivate *priv = e->priv;
+
+ if (priv->weight == weight && priv->weight_set)
+ return;
+
+ priv->weight = weight;
+ priv->weight_set = TRUE;
+
+ update_fonts (e);
+
+ g_object_notify (G_OBJECT (e), "weight");
+ g_object_notify (G_OBJECT (e), "weight-set");
+}
+
+gint
+cc_editable_entry_get_weight (CcEditableEntry *e)
+{
+ return e->priv->weight;
+}
+
+void
+cc_editable_entry_set_scale (CcEditableEntry *e,
+ gdouble scale)
+{
+ CcEditableEntryPrivate *priv = e->priv;
+
+ if (priv->scale == scale && priv->scale_set)
+ return;
+
+ priv->scale = scale;
+ priv->scale_set = TRUE;
+
+ update_fonts (e);
+
+ g_object_notify (G_OBJECT (e), "scale");
+ g_object_notify (G_OBJECT (e), "scale-set");
+}
+
+gdouble
+cc_editable_entry_get_scale (CcEditableEntry *e)
+{
+ return e->priv->scale;
+}
+
+static void
+cc_editable_entry_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ CcEditableEntry *e = CC_EDITABLE_ENTRY (object);
+
+ switch (prop_id) {
+ case PROP_TEXT:
+ cc_editable_entry_set_text (e, g_value_get_string (value));
+ break;
+ case PROP_EDITABLE:
+ cc_editable_entry_set_editable (e, g_value_get_boolean (value));
+ break;
+ case PROP_SELECTABLE:
+ cc_editable_entry_set_selectable (e, g_value_get_boolean (value));
+ break;
+ case PROP_WEIGHT:
+ cc_editable_entry_set_weight (e, g_value_get_int (value));
+ break;
+ case PROP_WEIGHT_SET:
+ e->priv->weight_set = g_value_get_boolean (value);
+ break;
+ case PROP_SCALE:
+ cc_editable_entry_set_scale (e, g_value_get_double (value));
+ break;
+ case PROP_SCALE_SET:
+ e->priv->scale_set = g_value_get_boolean (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+cc_editable_entry_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ CcEditableEntry *e = CC_EDITABLE_ENTRY (object);
+
+ switch (prop_id) {
+ case PROP_TEXT:
+ g_value_set_string (value,
+ cc_editable_entry_get_text (e));
+ break;
+ case PROP_EDITABLE:
+ g_value_set_boolean (value,
+ cc_editable_entry_get_editable (e));
+ break;
+ case PROP_SELECTABLE:
+ g_value_set_boolean (value,
+ cc_editable_entry_get_selectable (e));
+ break;
+ case PROP_WEIGHT:
+ g_value_set_int (value,
+ cc_editable_entry_get_weight (e));
+ break;
+ case PROP_WEIGHT_SET:
+ g_value_set_boolean (value, e->priv->weight_set);
+ break;
+ case PROP_SCALE:
+ g_value_set_double (value,
+ cc_editable_entry_get_scale (e));
+ break;
+ case PROP_SCALE_SET:
+ g_value_set_boolean (value, e->priv->scale_set);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+cc_editable_entry_finalize (GObject *object)
+{
+ CcEditableEntry *e = (CcEditableEntry*)object;
+
+ g_free (e->priv->text);
+
+ G_OBJECT_CLASS (cc_editable_entry_parent_class)->finalize (object);
+}
+
+static void
+cc_editable_entry_class_init (CcEditableEntryClass *class)
+{
+ GObjectClass *object_class;
+
+ object_class = G_OBJECT_CLASS (class);
+
+ object_class->set_property = cc_editable_entry_set_property;
+ object_class->get_property = cc_editable_entry_get_property;
+ object_class->finalize = cc_editable_entry_finalize;
+
+ signals[EDITING_DONE] =
+ g_signal_new ("editing-done",
+ G_TYPE_FROM_CLASS (class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (CcEditableEntryClass, editing_done),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ g_object_class_install_property (object_class, PROP_TEXT,
+ g_param_spec_string ("text",
+ "Text", "The text of the button",
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_EDITABLE,
+ g_param_spec_boolean ("editable",
+ "Editable", "Whether the text can be edited",
+ FALSE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_SELECTABLE,
+ g_param_spec_boolean ("selectable",
+ "Selectable", "Whether the text can be selected by mouse",
+ FALSE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_WEIGHT,
+ g_param_spec_int ("weight",
+ "Font Weight", "The font weight to use",
+ 0, G_MAXINT, PANGO_WEIGHT_NORMAL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_WEIGHT_SET,
+ g_param_spec_boolean ("weight-set",
+ "Font Weight Set", "Whether a font weight is set",
+ FALSE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_SCALE,
+ g_param_spec_double ("scale",
+ "Font Scale", "The font scale to use",
+ 0.0, G_MAXDOUBLE, 1.0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_SCALE_SET,
+ g_param_spec_boolean ("scale-set",
+ "Font Scale Set", "Whether a font scale is set",
+ FALSE,
+ G_PARAM_READWRITE));
+
+ g_type_class_add_private (class, sizeof (CcEditableEntryPrivate));
+}
+
+static void
+start_editing (CcEditableEntry *e)
+{
+ gtk_notebook_set_current_page (e->priv->notebook, PAGE_ENTRY);
+}
+
+static void
+stop_editing (CcEditableEntry *e)
+{
+ /* Avoid launching another "editing-done" signal
+ * caused by the notebook page change */
+ if (e->priv->in_stop_editing)
+ return;
+
+ e->priv->in_stop_editing = TRUE;
+ gtk_notebook_set_current_page (e->priv->notebook, PAGE_BUTTON);
+ cc_editable_entry_set_text (e, gtk_entry_get_text (e->priv->entry));
+ g_signal_emit (e, signals[EDITING_DONE], 0);
+ e->priv->in_stop_editing = FALSE;
+}
+
+static void
+cancel_editing (CcEditableEntry *e)
+{
+ gtk_entry_set_text (e->priv->entry, cc_editable_entry_get_text (e));
+ gtk_notebook_set_current_page (e->priv->notebook, PAGE_BUTTON);
+}
+
+static void
+button_clicked (GtkWidget *widget,
+ CcEditableEntry *e)
+{
+ start_editing (e);
+}
+
+static void
+entry_activated (GtkWidget *widget,
+ CcEditableEntry *e)
+{
+ stop_editing (e);
+}
+
+static gboolean
+entry_focus_out (GtkWidget *widget,
+ GdkEventFocus *event,
+ CcEditableEntry *e)
+{
+ stop_editing (e);
+ return FALSE;
+}
+
+static gboolean
+entry_key_press (GtkWidget *widget,
+ GdkEventKey *event,
+ CcEditableEntry *e)
+{
+ if (event->keyval == GDK_KEY_Escape) {
+ cancel_editing (e);
+ }
+ return FALSE;
+}
+
+static void
+update_button_padding (GtkWidget *widget,
+ GtkAllocation *allocation,
+ CcEditableEntry *e)
+{
+ CcEditableEntryPrivate *priv = e->priv;
+ GtkAllocation alloc;
+ gint offset;
+ gint pad;
+
+ gtk_widget_get_allocation (gtk_widget_get_parent (widget), &alloc);
+
+ offset = allocation->x - alloc.x;
+
+ gtk_misc_get_padding (GTK_MISC (priv->label), &pad, NULL);
+ if (offset != pad)
+ gtk_misc_set_padding (GTK_MISC (priv->label), offset, 0);
+}
+
+static void
+cc_editable_entry_init (CcEditableEntry *e)
+{
+ CcEditableEntryPrivate *priv;
+
+ priv = e->priv = CC_EDITABLE_ENTRY_GET_PRIVATE (e);
+
+ priv->weight = PANGO_WEIGHT_NORMAL;
+ priv->weight_set = FALSE;
+ priv->scale = 1.0;
+ priv->scale_set = FALSE;
+
+ priv->notebook = (GtkNotebook*)gtk_notebook_new ();
+ gtk_notebook_set_show_tabs (priv->notebook, FALSE);
+ gtk_notebook_set_show_border (priv->notebook, FALSE);
+
+ /* Label */
+ priv->label = (GtkLabel*)gtk_label_new (EMPTY_TEXT);
+ gtk_misc_set_alignment (GTK_MISC (priv->label), 0.0, 0.5);
+ gtk_notebook_append_page (priv->notebook, (GtkWidget*)priv->label, NULL);
+
+ /* Button */
+ priv->button = (GtkButton*)gtk_button_new_with_label (EMPTY_TEXT);
+ gtk_widget_set_receives_default ((GtkWidget*)priv->button, TRUE);
+ gtk_button_set_relief (priv->button, GTK_RELIEF_NONE);
+ gtk_button_set_alignment (priv->button, 0.0, 0.5);
+ gtk_notebook_append_page (priv->notebook, (GtkWidget*)priv->button, NULL);
+ g_signal_connect (priv->button, "clicked", G_CALLBACK (button_clicked), e);
+
+ /* Entry */
+ priv->entry = (GtkEntry*)gtk_entry_new ();
+ gtk_notebook_append_page (priv->notebook, (GtkWidget*)priv->entry, NULL);
+
+ g_signal_connect (priv->entry, "activate", G_CALLBACK (entry_activated), e);
+ g_signal_connect (priv->entry, "focus-out-event", G_CALLBACK (entry_focus_out), e);
+ g_signal_connect (priv->entry, "key-press-event", G_CALLBACK (entry_key_press), e);
+ g_signal_connect (priv->entry, "style-updated", G_CALLBACK (update_entry_font), e);
+ g_signal_connect (gtk_bin_get_child (GTK_BIN (priv->button)), "size-allocate", G_CALLBACK (update_button_padding), e);
+
+ gtk_container_add (GTK_CONTAINER (e), (GtkWidget*)priv->notebook);
+
+ gtk_widget_show ((GtkWidget*)priv->notebook);
+ gtk_widget_show ((GtkWidget*)priv->label);
+ gtk_widget_show ((GtkWidget*)priv->button);
+ gtk_widget_show ((GtkWidget*)priv->entry);
+
+ gtk_notebook_set_current_page (priv->notebook, PAGE_LABEL);
+}
+
+GtkWidget *
+cc_editable_entry_new (void)
+{
+ return (GtkWidget *) g_object_new (CC_TYPE_EDITABLE_ENTRY, NULL);
+}
Added: trunk/control-center-gnome/src/cut-n-paste/shell/cc-editable-entry.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cut-n-p…
==============================================================================
--- trunk/control-center-gnome/src/cut-n-paste/shell/cc-editable-entry.h (added)
+++ trunk/control-center-gnome/src/cut-n-paste/shell/cc-editable-entry.h Wed Jan 11 12:02:37 2012
@@ -0,0 +1,75 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright 2009-2010 Red Hat, Inc,
+ *
+ * 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 3 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 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.
+ *
+ * Written by: Matthias Clasen <mclasen(a)redhat.com>
+ */
+
+#ifndef _CC_EDITABLE_ENTRY_H_
+#define _CC_EDITABLE_ENTRY_H_
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define CC_TYPE_EDITABLE_ENTRY cc_editable_entry_get_type()
+
+#define CC_EDITABLE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CC_TYPE_EDITABLE_ENTRY, CcEditableEntry))
+#define CC_EDITABLE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CC_TYPE_EDITABLE_ENTRY, CcEditableEntryClass))
+#define CC_IS_EDITABLE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CC_TYPE_EDITABLE_ENTRY))
+#define CC_IS_EDITABLE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CC_TYPE_EDITABLE_ENTRY))
+#define CC_EDITABLE_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CC_TYPE_EDITABLE_ENTRY, CcEditableEntryClass))
+
+typedef struct _CcEditableEntry CcEditableEntry;
+typedef struct _CcEditableEntryClass CcEditableEntryClass;
+typedef struct _CcEditableEntryPrivate CcEditableEntryPrivate;
+
+struct _CcEditableEntry
+{
+ GtkAlignment parent;
+
+ CcEditableEntryPrivate *priv;
+};
+
+struct _CcEditableEntryClass
+{
+ GtkAlignmentClass parent_class;
+
+ void (* editing_done) (CcEditableEntry *entry);
+};
+
+GType cc_editable_entry_get_type (void) G_GNUC_CONST;
+GtkWidget *cc_editable_entry_new (void);
+void cc_editable_entry_set_text (CcEditableEntry *entry,
+ const gchar *text);
+const gchar *cc_editable_entry_get_text (CcEditableEntry *entry);
+void cc_editable_entry_set_editable (CcEditableEntry *entry,
+ gboolean editable);
+gboolean cc_editable_entry_get_editable (CcEditableEntry *entry);
+void cc_editable_entry_set_selectable (CcEditableEntry *entry,
+ gboolean selectable);
+gboolean cc_editable_entry_get_selectable (CcEditableEntry *entry);
+void cc_editable_entry_set_weight (CcEditableEntry *entry,
+ gint weight);
+gint cc_editable_entry_get_weight (CcEditableEntry *entry);
+void cc_editable_entry_set_scale (CcEditableEntry *entry,
+ gdouble scale);
+gdouble cc_editable_entry_get_scale (CcEditableEntry *entry);
+
+G_END_DECLS
+
+#endif /* _CC_EDITABLE_ENTRY_H_ */
Added: trunk/control-center-gnome/src/cut-n-paste/shell/cc-panel.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cut-n-p…
==============================================================================
--- trunk/control-center-gnome/src/cut-n-paste/shell/cc-panel.c (added)
+++ trunk/control-center-gnome/src/cut-n-paste/shell/cc-panel.c Wed Jan 11 12:02:37 2012
@@ -0,0 +1,248 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
+ *
+ * Copyright (C) 2010 Red Hat, Inc.
+ * Copyright (C) 2010 Intel, Inc
+ *
+ * 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 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.
+ *
+ * Authors: William Jon McCann <jmccann(a)redhat.com>
+ * Thomas Wood <thomas.wood(a)intel.com>
+ *
+ */
+
+/**
+ * SECTION:cc-panel
+ * @short_description: An abstract class for Control Center panels
+ *
+ * CcPanel is an abstract class used to implement panels for the shell. A
+ * panel contains a collection of related settings that are displayed within
+ * the shell window.
+ */
+
+#include "config.h"
+
+#include "cc-panel.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include <gtk/gtk.h>
+#include <gio/gio.h>
+
+#define CC_PANEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CC_TYPE_PANEL, CcPanelPrivate))
+
+struct CcPanelPrivate
+{
+ gchar *id;
+ gchar *display_name;
+ gchar *category;
+ gchar *current_location;
+
+ gboolean is_active;
+ CcShell *shell;
+};
+
+enum
+{
+ PROP_0,
+ PROP_SHELL,
+ PROP_ARGV
+};
+
+G_DEFINE_ABSTRACT_TYPE (CcPanel, cc_panel, GTK_TYPE_BIN)
+
+static void
+cc_panel_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ CcPanel *panel;
+
+ panel = CC_PANEL (object);
+
+ switch (prop_id)
+ {
+ case PROP_SHELL:
+ /* construct only property */
+ panel->priv->shell = g_value_get_object (value);
+ break;
+
+ case PROP_ARGV:
+ {
+ gchar **argv = g_value_get_boxed (value);
+ if (argv && argv[0])
+ g_warning ("Ignoring additional argument %s", argv[0]);
+ break;
+ }
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+cc_panel_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ CcPanel *panel;
+
+ panel = CC_PANEL (object);
+
+ switch (prop_id)
+ {
+ case PROP_SHELL:
+ g_value_set_object (value, panel->priv->shell);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+cc_panel_finalize (GObject *object)
+{
+ CcPanel *panel;
+
+ g_return_if_fail (object != NULL);
+ g_return_if_fail (CC_IS_PANEL (object));
+
+ panel = CC_PANEL (object);
+
+ g_free (panel->priv->id);
+ g_free (panel->priv->display_name);
+
+ G_OBJECT_CLASS (cc_panel_parent_class)->finalize (object);
+}
+
+static void
+cc_panel_get_preferred_width (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
+{
+ GtkBin *bin = GTK_BIN (widget);
+ GtkWidget *child;
+
+ if (minimum != NULL)
+ *minimum = 0;
+
+ if (natural != NULL)
+ *natural = 0;
+
+ if ((child = gtk_bin_get_child (bin)))
+ gtk_widget_get_preferred_width (child, minimum, natural);
+}
+
+static void
+cc_panel_get_preferred_height (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
+{
+ GtkBin *bin = GTK_BIN (widget);
+ GtkWidget *child;
+
+ if (minimum != NULL)
+ *minimum = 0;
+
+ if (natural != NULL)
+ *natural = 0;
+
+ if ((child = gtk_bin_get_child (bin)))
+ gtk_widget_get_preferred_height (child, minimum, natural);
+}
+
+static void
+cc_panel_size_allocate (GtkWidget *widget,
+ GtkAllocation *allocation)
+{
+ GtkAllocation child_allocation;
+
+ gtk_widget_set_allocation (widget, allocation);
+
+ child_allocation = *allocation;
+
+ gtk_widget_size_allocate (gtk_bin_get_child (GTK_BIN (widget)),
+ &child_allocation);
+}
+
+static void
+cc_panel_class_init (CcPanelClass *klass)
+{
+ GParamSpec *pspec;
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+ object_class->get_property = cc_panel_get_property;
+ object_class->set_property = cc_panel_set_property;
+ object_class->finalize = cc_panel_finalize;
+
+ widget_class->get_preferred_width = cc_panel_get_preferred_width;
+ widget_class->get_preferred_height = cc_panel_get_preferred_height;
+ widget_class->size_allocate = cc_panel_size_allocate;
+
+ gtk_container_class_handle_border_width (GTK_CONTAINER_CLASS (klass));
+
+ g_type_class_add_private (klass, sizeof (CcPanelPrivate));
+
+ pspec = g_param_spec_object ("shell",
+ "Shell",
+ "Shell the Panel resides in",
+ CC_TYPE_SHELL,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS
+ | G_PARAM_CONSTRUCT_ONLY);
+ g_object_class_install_property (object_class, PROP_SHELL, pspec);
+
+ pspec = g_param_spec_boxed ("argv",
+ "Argument vector",
+ "Additional arguments passed on the command line",
+ G_TYPE_STRV,
+ G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY);
+ g_object_class_install_property (object_class, PROP_ARGV, pspec);
+}
+
+static void
+cc_panel_init (CcPanel *panel)
+{
+ panel->priv = CC_PANEL_GET_PRIVATE (panel);
+}
+
+/**
+ * cc_panel_get_shell:
+ * @panel: A #CcPanel
+ *
+ * Get the shell that the panel resides in
+ *
+ * Returns: a #CcShell
+ */
+CcShell *
+cc_panel_get_shell (CcPanel *panel)
+{
+ return panel->priv->shell;
+}
+
+GPermission *
+cc_panel_get_permission (CcPanel *panel)
+{
+ CcPanelClass *class = CC_PANEL_GET_CLASS (panel);
+
+ if (class->get_permission)
+ return class->get_permission (panel);
+
+ return NULL;
+}
Added: trunk/control-center-gnome/src/cut-n-paste/shell/cc-panel.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cut-n-p…
==============================================================================
--- trunk/control-center-gnome/src/cut-n-paste/shell/cc-panel.h (added)
+++ trunk/control-center-gnome/src/cut-n-paste/shell/cc-panel.h Wed Jan 11 12:02:37 2012
@@ -0,0 +1,81 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
+ *
+ * Copyright (C) 2010 Red Hat, Inc.
+ * Copyright (C) 2010 Intel, Inc
+ *
+ * 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 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.
+ *
+ * Authors: William Jon McCann <jmccann(a)redhat.com>
+ * Thomas Wood <thomas.wood(a)intel.com>
+ */
+
+
+#ifndef __CC_PANEL_H
+#define __CC_PANEL_H
+
+#include <glib-object.h>
+#include <gtk/gtk.h>
+
+
+G_BEGIN_DECLS
+
+#define CC_TYPE_PANEL (cc_panel_get_type ())
+#define CC_PANEL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CC_TYPE_PANEL, CcPanel))
+#define CC_PANEL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), CC_TYPE_PANEL, CcPanelClass))
+#define CC_IS_PANEL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CC_TYPE_PANEL))
+#define CC_IS_PANEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CC_TYPE_PANEL))
+#define CC_PANEL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), CC_TYPE_PANEL, CcPanelClass))
+
+typedef struct CcPanelPrivate CcPanelPrivate;
+
+typedef struct _CcPanel CcPanel;
+typedef struct _CcPanelClass CcPanelClass;
+
+/* cc-shell.h requires CcPanel, so make sure it is defined first */
+#include "cc-shell.h"
+
+/**
+ * CcPanel:
+ *
+ * The contents of this struct are private and should not be accessed directly.
+ */
+struct _CcPanel
+{
+ /*< private >*/
+ GtkBin parent;
+ CcPanelPrivate *priv;
+};
+/**
+ * CcPanelClass:
+ *
+ * The contents of this struct are private and should not be accessed directly.
+ */
+struct _CcPanelClass
+{
+ /*< private >*/
+ GtkBinClass parent_class;
+
+ GPermission * (* get_permission) (CcPanel *panel);
+};
+
+GType cc_panel_get_type (void);
+
+CcShell* cc_panel_get_shell (CcPanel *panel);
+
+GPermission *cc_panel_get_permission (CcPanel *panel);
+
+G_END_DECLS
+
+#endif /* __CC_PANEL_H */
Modified: trunk/control-center-gnome/src/cut-n-paste/shell/cc-shell-category-view.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cut-n-p…
==============================================================================
--- trunk/control-center-gnome/src/cut-n-paste/shell/cc-shell-category-view.c (original)
+++ trunk/control-center-gnome/src/cut-n-paste/shell/cc-shell-category-view.c Wed Jan 11 12:02:37 2012
@@ -115,39 +115,26 @@
}
static void
-label_style_set_cb (GtkWidget *widget,
- GtkStyle *old_style,
- gpointer user_data)
-{
- GtkStyle *style;
-
- /* "base" colours are used for the background inside CcShellCategoryView,
- * so set the labels to use the "text" colors */
-
- g_signal_handlers_block_by_func (widget, label_style_set_cb, NULL);
-
- style = gtk_widget_get_style (widget);
-
- gtk_widget_modify_fg (widget, GTK_STATE_NORMAL,
- &style->text[GTK_STATE_NORMAL]);
-
- g_signal_handlers_unblock_by_func (widget, label_style_set_cb, NULL);
-}
-
-
-
-static void
cc_shell_category_view_constructed (GObject *object)
{
CcShellCategoryViewPrivate *priv = CC_SHELL_CATEGORY_VIEW (object)->priv;
GtkWidget *iconview, *vbox;
+ GtkCellRenderer *renderer;
iconview = cc_shell_item_view_new ();
gtk_icon_view_set_model (GTK_ICON_VIEW (iconview), priv->model);
vbox = gtk_vbox_new (FALSE, 0);
- gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW (iconview), COL_PIXBUF);
+ renderer = gtk_cell_renderer_pixbuf_new ();
+ g_object_set (renderer,
+ "follow-state", TRUE,
+ NULL);
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (iconview),
+ renderer, FALSE);
+ gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (iconview), renderer,
+ "pixbuf", COL_PIXBUF);
+
gtk_icon_view_set_text_column (GTK_ICON_VIEW (iconview), COL_NAME);
gtk_icon_view_set_item_width (GTK_ICON_VIEW (iconview), 100);
cc_shell_item_view_update_cells (CC_SHELL_ITEM_VIEW (iconview));
@@ -164,9 +151,7 @@
gtk_label_set_attributes (GTK_LABEL (label), attrs);
pango_attr_list_unref (attrs);
gtk_frame_set_label_widget (GTK_FRAME (object), label);
-
- g_signal_connect (label, "style-set", G_CALLBACK (label_style_set_cb),
- NULL);
+ gtk_widget_show (label);
}
/* add the iconview to the vbox */
@@ -179,35 +164,11 @@
priv->iconview = iconview;
}
-static gboolean
-cc_shell_category_view_draw (GtkWidget *widget,
- cairo_t *cr)
-{
- GtkStyle *style;
- GtkStateType state;
- GtkAllocation allocation;
-
- style = gtk_widget_get_style (widget);
- state = gtk_widget_get_state (widget);
- gtk_widget_get_allocation (widget, &allocation);
-
-
- cairo_rectangle (cr, 0, 0, allocation.width, allocation.height);
- gdk_cairo_set_source_color (cr, &style->base[state]);
-
- cairo_fill (cr);
-
- GTK_WIDGET_CLASS (cc_shell_category_view_parent_class)->draw (widget, cr);
-
- return FALSE;
-}
-
static void
cc_shell_category_view_class_init (CcShellCategoryViewClass *klass)
{
GParamSpec *pspec;
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
g_type_class_add_private (klass, sizeof (CcShellCategoryViewPrivate));
@@ -217,8 +178,6 @@
object_class->finalize = cc_shell_category_view_finalize;
object_class->constructed = cc_shell_category_view_constructed;
- widget_class->draw = cc_shell_category_view_draw;
-
pspec = g_param_spec_string ("name",
"Name",
"Name of the category",
Modified: trunk/control-center-gnome/src/cut-n-paste/shell/cc-shell-model.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cut-n-p…
==============================================================================
--- trunk/control-center-gnome/src/cut-n-paste/shell/cc-shell-model.c (original)
+++ trunk/control-center-gnome/src/cut-n-paste/shell/cc-shell-model.c Wed Jan 11 12:02:37 2012
@@ -24,7 +24,7 @@
#define GNOME_SETTINGS_PANEL_ID_KEY "X-GNOME-Settings-Panel"
#define GNOME_SETTINGS_PANEL_CATEGORY GNOME_SETTINGS_PANEL_ID_KEY
-#define GNOME_SETTINGS_PANEL_ID_KEYWORDS "X-GNOME-Keywords"
+#define GNOME_SETTINGS_PANEL_ID_KEYWORDS "Keywords"
G_DEFINE_TYPE (CcShellModel, cc_shell_model, GTK_TYPE_LIST_STORE)
@@ -34,7 +34,7 @@
{
GtkIconTheme *theme;
GtkIconInfo *icon_info;
- GdkPixbuf *pixbuf;
+ GdkPixbuf *pixbuf = NULL;
GError *err = NULL;
if (icon == NULL)
Added: trunk/control-center-gnome/src/cut-n-paste/shell/cc-shell.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cut-n-p…
==============================================================================
--- trunk/control-center-gnome/src/cut-n-paste/shell/cc-shell.c (added)
+++ trunk/control-center-gnome/src/cut-n-paste/shell/cc-shell.c Wed Jan 11 12:02:37 2012
@@ -0,0 +1,259 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
+ *
+ * Copyright (c) 2010 Intel, Inc.
+ *
+ * The Control Center 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.
+ *
+ * The Control Center 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 General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with the Control Center; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Author: Thomas Wood <thos(a)gnome.org>
+ */
+
+/**
+ * SECTION:cc-shell
+ * @short_description: Abstract class representing the Control Center shell
+ *
+ * CcShell is an abstract class that represents an instance of a control
+ * center shell. It provides access to some of the properties of the shell
+ * that panels will need to read or change. When a panel is created it has an
+ * instance of CcShell available that represents the current shell.
+ */
+
+
+#include "cc-shell.h"
+#include "cc-panel.h"
+
+G_DEFINE_ABSTRACT_TYPE (CcShell, cc_shell, G_TYPE_OBJECT)
+
+#define SHELL_PRIVATE(o) \
+ (G_TYPE_INSTANCE_GET_PRIVATE ((o), CC_TYPE_SHELL, CcShellPrivate))
+
+struct _CcShellPrivate
+{
+ CcPanel *active_panel;
+};
+
+enum
+{
+ PROP_ACTIVE_PANEL = 1
+};
+
+
+static void
+cc_shell_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ CcShell *shell = CC_SHELL (object);
+
+ switch (property_id)
+ {
+ case PROP_ACTIVE_PANEL:
+ g_value_set_object (value, shell->priv->active_panel);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ }
+}
+
+static void
+cc_shell_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ CcShell *shell = CC_SHELL (object);
+
+ switch (property_id)
+ {
+ case PROP_ACTIVE_PANEL:
+ cc_shell_set_active_panel (shell, g_value_get_object (value));
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ }
+}
+
+static void
+cc_shell_dispose (GObject *object)
+{
+ /* remove and unref the active shell */
+ cc_shell_set_active_panel (CC_SHELL (object), NULL);
+
+ G_OBJECT_CLASS (cc_shell_parent_class)->dispose (object);
+}
+
+static void
+cc_shell_class_init (CcShellClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GParamSpec *pspec;
+
+ g_type_class_add_private (klass, sizeof (CcShellPrivate));
+
+ object_class->get_property = cc_shell_get_property;
+ object_class->set_property = cc_shell_set_property;
+ object_class->dispose = cc_shell_dispose;
+
+ pspec = g_param_spec_object ("active-panel",
+ "active panel",
+ "The currently active Panel",
+ CC_TYPE_PANEL,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (object_class, PROP_ACTIVE_PANEL, pspec);
+}
+
+static void
+cc_shell_init (CcShell *self)
+{
+ self->priv = SHELL_PRIVATE (self);
+}
+
+/**
+ * cc_shell_get_active_panel:
+ * @shell: A #CcShell
+ *
+ * Get the current active panel
+ *
+ * Returns: a #CcPanel or NULL if no panel is active
+ */
+CcPanel*
+cc_shell_get_active_panel (CcShell *shell)
+{
+ g_return_val_if_fail (CC_IS_SHELL (shell), NULL);
+
+ return shell->priv->active_panel;
+}
+
+/**
+ * cc_shell_set_active_panel:
+ * @shell: A #CcShell
+ * @panel: A #CcPanel
+ *
+ * Set the current active panel. If @panel is NULL, then the shell is returned
+ * to a state where no panel is being displayed (for example, the list of panels
+ * may be shown instead).
+ *
+ */
+void
+cc_shell_set_active_panel (CcShell *shell,
+ CcPanel *panel)
+{
+ g_return_if_fail (CC_IS_SHELL (shell));
+ g_return_if_fail (panel == NULL || CC_IS_PANEL (panel));
+
+ if (panel != shell->priv->active_panel)
+ {
+ /* remove the old panel */
+ g_object_unref (shell->priv->active_panel);
+ shell->priv->active_panel = NULL;
+
+ /* set the new panel */
+ if (panel)
+ {
+ shell->priv->active_panel = g_object_ref (panel);
+ g_object_set (G_OBJECT (panel), "shell", shell, NULL);
+ }
+ g_object_notify (G_OBJECT (shell), "active-panel");
+ }
+}
+
+/**
+ * cc_shell_set_active_panel_from_id:
+ * @shell: A #CcShell
+ * @id: the ID of the panel to set as active
+ * @error: A #GError
+ *
+ * Find a panel corresponding to the specified id and set it as active.
+ *
+ * Returns: #TRUE if the panel was found and set as the active panel
+ */
+gboolean
+cc_shell_set_active_panel_from_id (CcShell *shell,
+ const gchar *id,
+ const gchar **argv,
+ GError **error)
+{
+ CcShellClass *class;
+
+ g_return_val_if_fail (CC_IS_SHELL (shell), FALSE);
+
+
+ class = (CcShellClass *) G_OBJECT_GET_CLASS (shell);
+
+ if (!class->set_active_panel_from_id)
+ {
+ g_warning ("Object of type \"%s\" does not implement required virtual"
+ " function \"set_active_panel_from_id\",",
+ G_OBJECT_TYPE_NAME (shell));
+ return FALSE;
+ }
+ else
+ {
+ return class->set_active_panel_from_id (shell, id, argv, error);
+ }
+}
+
+/**
+ * cc_shell_get_toplevel:
+ * @shell: A #CcShell
+ *
+ * Gets the toplevel window of the shell.
+ *
+ * Returns: The #GtkWidget of the shell window, or #NULL on error.
+ */
+GtkWidget *
+cc_shell_get_toplevel (CcShell *shell)
+{
+ CcShellClass *klass;
+
+ g_return_val_if_fail (CC_IS_SHELL (shell), NULL);
+
+ klass = CC_SHELL_GET_CLASS (shell);
+
+ if (klass->get_toplevel)
+ {
+ return klass->get_toplevel (shell);
+ }
+
+ g_warning ("Object of type \"%s\" does not implement required virtual"
+ " function \"get_toplevel\",",
+ G_OBJECT_TYPE_NAME (shell));
+
+ return NULL;
+}
+
+void
+cc_shell_embed_widget_in_header (CcShell *shell, GtkWidget *widget)
+{
+ CcShellClass *class;
+
+ g_return_if_fail (CC_IS_SHELL (shell));
+
+ class = (CcShellClass *) G_OBJECT_GET_CLASS (shell);
+
+ if (!class->embed_widget_in_header)
+ {
+ g_warning ("Object of type \"%s\" does not implement required virtual"
+ " function \"embed_widget_in_header\",",
+ G_OBJECT_TYPE_NAME (shell));
+ return FALSE;
+ }
+ else
+ {
+ return class->embed_widget_in_header (shell, widget);
+ }
+}
Added: trunk/control-center-gnome/src/cut-n-paste/shell/cc-shell.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cut-n-p…
==============================================================================
--- trunk/control-center-gnome/src/cut-n-paste/shell/cc-shell.h (added)
+++ trunk/control-center-gnome/src/cut-n-paste/shell/cc-shell.h Wed Jan 11 12:02:37 2012
@@ -0,0 +1,112 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
+ *
+ * Copyright (c) 2010 Intel, Inc.
+ *
+ * The Control Center 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.
+ *
+ * The Control Center 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 General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with the Control Center; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Author: Thomas Wood <thos(a)gnome.org>
+ */
+
+#ifndef _CC_SHELL_H
+#define _CC_SHELL_H
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define CC_TYPE_SHELL cc_shell_get_type()
+
+#define CC_SHELL(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ CC_TYPE_SHELL, CcShell))
+
+#define CC_SHELL_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), \
+ CC_TYPE_SHELL, CcShellClass))
+
+#define CC_IS_SHELL(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+ CC_TYPE_SHELL))
+
+#define CC_IS_SHELL_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+ CC_TYPE_SHELL))
+
+#define CC_SHELL_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+ CC_TYPE_SHELL, CcShellClass))
+
+
+#define CC_SHELL_PANEL_EXTENSION_POINT "control-center-1"
+
+typedef struct _CcShell CcShell;
+typedef struct _CcShellClass CcShellClass;
+typedef struct _CcShellPrivate CcShellPrivate;
+
+/* cc-panel.h requires CcShell, so make sure they are defined first */
+#include "cc-panel.h"
+
+/**
+ * CcShell:
+ *
+ * The contents of this struct are private should not be accessed directly.
+ */
+struct _CcShell
+{
+ /*< private >*/
+ GObject parent;
+
+ CcShellPrivate *priv;
+};
+
+/**
+ * CcShellClass:
+ * @set_active_panel_from_id: virtual function to set the active panel from an
+ * id string
+ *
+ */
+struct _CcShellClass
+{
+ /*< private >*/
+ GObjectClass parent_class;
+
+ /*< public >*/
+ /* vfuncs */
+ gboolean (*set_active_panel_from_id) (CcShell *shell,
+ const gchar *id,
+ const gchar **argv,
+ GError **error);
+ GtkWidget * (*get_toplevel) (CcShell *shell);
+ void (*embed_widget_in_header) (CcShell *shell,
+ GtkWidget *widget);
+};
+
+GType cc_shell_get_type (void) G_GNUC_CONST;
+
+CcPanel* cc_shell_get_active_panel (CcShell *shell);
+void cc_shell_set_active_panel (CcShell *shell,
+ CcPanel *panel);
+gboolean cc_shell_set_active_panel_from_id (CcShell *shell,
+ const gchar *id,
+ const gchar **argv,
+ GError **error);
+GtkWidget * cc_shell_get_toplevel (CcShell *shell);
+
+void cc_shell_embed_widget_in_header (CcShell *shell,
+ GtkWidget *widget);
+
+G_END_DECLS
+
+#endif /* _CC_SHELL_H */
Modified: trunk/control-center-gnome/src/cut-n-paste/shell/control-center.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cut-n-p…
==============================================================================
--- trunk/control-center-gnome/src/cut-n-paste/shell/control-center.c (original)
+++ trunk/control-center-gnome/src/cut-n-paste/shell/control-center.c Wed Jan 11 12:02:37 2012
@@ -127,7 +127,12 @@
start_id = start_panels[0];
- if (!cc_shell_set_active_panel_from_id (CC_SHELL (shell), start_id, &err))
+ if (start_panels[1])
+ g_debug ("Extra argument: %s", start_panels[1]);
+ else
+ g_debug ("No extra argument");
+
+ if (!cc_shell_set_active_panel_from_id (CC_SHELL (shell), start_id, (const gchar**)start_panels+1, &err))
{
g_warning ("Could not load setting panel \"%s\": %s", start_id,
(err) ? err->message : "Unknown error");
@@ -174,8 +179,6 @@
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
-
- g_thread_init (NULL);
gtk_init (&argc, &argv);
cc_shell_log_init ();
Modified: trunk/control-center-gnome/src/cut-n-paste/shell/gnome-control-center.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cut-n-p…
==============================================================================
--- trunk/control-center-gnome/src/cut-n-paste/shell/gnome-control-center.c (original)
+++ trunk/control-center-gnome/src/cut-n-paste/shell/gnome-control-center.c Wed Jan 11 12:02:37 2012
@@ -44,6 +44,14 @@
#define W(b,x) GTK_WIDGET (gtk_builder_get_object (b, x))
+/* Use a fixed width for the shell, since resizing horizontally is more awkward
+ * for the user than resizing vertically
+ * Both sizes are defined in https://live.gnome.org/Design/SystemSettings/ */
+#define FIXED_WIDTH 675
+#define FIXED_HEIGHT 530
+
+#define MIN_ICON_VIEW_HEIGHT 300
+
enum
{
OVERVIEW_PAGE,
@@ -61,6 +69,7 @@
GtkWidget *window;
GtkWidget *search_entry;
GtkWidget *lock_button;
+ GPtrArray *custom_widgets;
GMenuTree *menu_tree;
GtkListStore *store;
@@ -79,11 +88,6 @@
gchar *default_window_icon;
};
-/* Use a fixed width for the shell, since resizing horizontally is more awkward
- * for the user than resizing vertically */
-#define FIXED_WIDTH 675
-
-
static const gchar *
get_icon_name_from_g_icon (GIcon *gicon)
{
@@ -109,6 +113,7 @@
static void
activate_panel (GnomeControlCenter *shell,
const gchar *id,
+ const gchar **argv,
const gchar *desktop_file,
const gchar *name,
GIcon *gicon)
@@ -151,7 +156,7 @@
const gchar *icon_name;
/* create the panel plugin */
- panel = g_object_new (panel_type, "shell", shell, NULL);
+ panel = g_object_new (panel_type, "shell", shell, "argv", argv, NULL);
gtk_lock_button_set_permission (GTK_LOCK_BUTTON (priv->lock_button),
cc_panel_get_permission (CC_PANEL (panel)));
@@ -178,7 +183,7 @@
/* set the scrolled window small so that it doesn't force
the window to be larger than this panel */
- gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (priv->scrolled_window), 50);
+ gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (priv->scrolled_window), MIN_ICON_VIEW_HEIGHT);
/* resize to the preferred size of the panel */
gtk_widget_set_size_request (priv->window, FIXED_WIDTH, -1);
@@ -197,6 +202,23 @@
}
static void
+_shell_remove_all_custom_widgets (GnomeControlCenterPrivate *priv)
+{
+ GtkBox *box;
+ GtkWidget *widget;
+ guint i;
+
+ /* remove from the header */
+ box = GTK_BOX (W (priv->builder, "topright"));
+ for (i = 0; i < priv->custom_widgets->len; i++)
+ {
+ widget = g_ptr_array_index (priv->custom_widgets, i);
+ gtk_container_remove (GTK_CONTAINER (box), widget);
+ }
+ g_ptr_array_set_size (priv->custom_widgets, 0);
+}
+
+static void
shell_show_overview_page (GnomeControlCenterPrivate *priv)
{
gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), OVERVIEW_PAGE);
@@ -207,6 +229,7 @@
g_free (priv->filter_string);
priv->filter_string = g_strdup ("");
gtk_entry_set_text (GTK_ENTRY (priv->search_entry), "");
+ gtk_widget_grab_focus (priv->search_entry);
gtk_lock_button_set_permission (GTK_LOCK_BUTTON (priv->lock_button), NULL);
@@ -215,6 +238,9 @@
gtk_window_set_default_icon_name (priv->default_window_icon);
gtk_window_set_icon_name (GTK_WINDOW (priv->window),
priv->default_window_icon);
+
+ /* clear any custom widgets */
+ _shell_remove_all_custom_widgets (priv);
}
void
@@ -232,7 +258,7 @@
{
GError *err = NULL;
- if (!cc_shell_set_active_panel_from_id (CC_SHELL (shell), id, &err))
+ if (!cc_shell_set_active_panel_from_id (CC_SHELL (shell), id, NULL, &err))
{
/* TODO: show message to user */
if (err)
@@ -556,6 +582,7 @@
setup_search (GnomeControlCenter *shell)
{
GtkWidget *search_scrolled, *search_view, *widget;
+ GtkCellRenderer *renderer;
GnomeControlCenterPrivate *priv = shell->priv;
g_return_if_fail (priv->store != NULL);
@@ -576,7 +603,15 @@
gtk_icon_view_set_spacing (GTK_ICON_VIEW (search_view), 6);
gtk_icon_view_set_model (GTK_ICON_VIEW (search_view),
GTK_TREE_MODEL (priv->search_filter));
- gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW (search_view), COL_PIXBUF);
+
+ renderer = gtk_cell_renderer_pixbuf_new ();
+ g_object_set (renderer,
+ "follow-state", TRUE,
+ NULL);
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (search_view),
+ renderer, FALSE);
+ gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (search_view), renderer,
+ "pixbuf", COL_PIXBUF);
search_scrolled = W (priv->builder, "search-scrolled-window");
gtk_container_add (GTK_CONTAINER (search_scrolled), search_view);
@@ -608,6 +643,8 @@
g_signal_connect (widget, "icon-release", G_CALLBACK (search_entry_clear_cb),
priv);
+
+ gtk_widget_show (priv->search_view);
}
static void
@@ -783,18 +820,35 @@
gtk_widget_hide (W (priv->builder, "home-button"));
gtk_widget_show (W (priv->builder, "search-entry"));
gtk_widget_hide (W (priv->builder, "lock-button"));
+ gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (priv->scrolled_window), FIXED_HEIGHT - 50);
}
else
{
gtk_widget_show (W (priv->builder, "home-button"));
gtk_widget_hide (W (priv->builder, "search-entry"));
+ gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (priv->scrolled_window), MIN_ICON_VIEW_HEIGHT);
}
}
/* CcShell implementation */
+static void
+_shell_embed_widget_in_header (CcShell *shell,
+ GtkWidget *widget)
+{
+ GnomeControlCenterPrivate *priv = GNOME_CONTROL_CENTER (shell)->priv;
+ GtkBox *box;
+
+ /* add to header */
+ box = GTK_BOX (W (priv->builder, "topright"));
+ gtk_box_pack_end (box, widget, FALSE, FALSE, 0);
+ g_ptr_array_add (priv->custom_widgets, g_object_ref (widget));
+}
+
+/* CcShell implementation */
static gboolean
_shell_set_active_panel_from_id (CcShell *shell,
const gchar *start_id,
+ const gchar **argv,
GError **err)
{
GtkTreeIter iter;
@@ -804,6 +858,8 @@
GIcon *gicon;
GnomeControlCenterPrivate *priv = GNOME_CONTROL_CENTER (shell)->priv;
+ /* clear any custom widgets */
+ _shell_remove_all_custom_widgets (priv);
iter_valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->store),
&iter);
@@ -850,8 +906,8 @@
{
gtk_notebook_remove_page (GTK_NOTEBOOK (priv->notebook), CAPPLET_PAGE);
- activate_panel (GNOME_CONTROL_CENTER (shell), start_id, desktop, name,
- gicon);
+ activate_panel (GNOME_CONTROL_CENTER (shell), start_id, argv, desktop,
+ name, gicon);
g_free (name);
g_free (desktop);
@@ -900,6 +956,11 @@
{
GnomeControlCenterPrivate *priv = GNOME_CONTROL_CENTER (object)->priv;
+ if (priv->custom_widgets)
+ {
+ g_ptr_array_unref (priv->custom_widgets);
+ priv->custom_widgets = NULL;
+ }
if (priv->window)
{
gtk_widget_destroy (priv->window);
@@ -986,82 +1047,11 @@
object_class->finalize = gnome_control_center_finalize;
shell_class->set_active_panel_from_id = _shell_set_active_panel_from_id;
+ shell_class->embed_widget_in_header = _shell_embed_widget_in_header;
shell_class->get_toplevel = _shell_get_toplevel;
}
static gboolean
-queue_resize (gpointer data)
-{
- GtkWidget *widget = data;
-
- gtk_widget_queue_resize (widget);
-
- return FALSE;
-}
-
-static void
-on_window_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation,
- GnomeControlCenter *self)
-{
- int height;
-
- if (gtk_notebook_get_current_page (GTK_NOTEBOOK (self->priv->notebook)) == OVERVIEW_PAGE)
- {
- gtk_widget_get_preferred_height_for_width (GTK_WIDGET (self->priv->main_vbox),
- FIXED_WIDTH,
- NULL,
- &height);
- if (gtk_widget_get_realized (widget))
- {
- int monitor;
- GdkScreen *screen;
- GdkRectangle rect;
- GdkWindow *window;
-
- window = gtk_widget_get_window (widget);
- screen = gtk_widget_get_screen (widget);
- monitor = gdk_screen_get_monitor_at_window (screen, window);
- gdk_screen_get_monitor_geometry (screen, monitor, &rect);
- height = MIN (height + 10, rect.height - 120);
- }
- }
- else
- {
- height = 50;
- }
-
- if (gtk_scrolled_window_get_min_content_height (GTK_SCROLLED_WINDOW (self->priv->scrolled_window)) != height)
- {
- gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (self->priv->scrolled_window), height);
- /*
- * Queueing a resize out of size-allocate is ignored,
- * so we have to defer to an idle.
- */
- g_idle_add (queue_resize, self->priv->scrolled_window);
- }
-}
-
-static void
-viewport_style_set_cb (GtkWidget *widget,
- GtkStyle *old_style,
- gpointer user_data)
-{
- GtkStyle *style;
-
- /* use "base" colours inside the viewport */
-
- g_signal_handlers_block_by_func (widget, viewport_style_set_cb, NULL);
-
- style = gtk_widget_get_style (widget);
-
- gtk_widget_modify_bg (widget, GTK_STATE_NORMAL,
- &style->base[GTK_STATE_NORMAL]);
-
- g_signal_handlers_unblock_by_func (widget, viewport_style_set_cb, NULL);
-}
-
-static gboolean
window_key_press_event (GtkWidget *win,
GdkEventKey *event,
GnomeControlCenter *self)
@@ -1070,9 +1060,6 @@
retval = FALSE;
- if (!gtk_widget_get_visible (self->priv->search_entry))
- return retval;
-
if (event->state != 0 &&
(event->state & GDK_CONTROL_MASK))
{
@@ -1082,14 +1069,23 @@
case GDK_KEY_S:
case GDK_KEY_f:
case GDK_KEY_F:
- gtk_widget_grab_focus (self->priv->search_entry);
- retval = TRUE;
+ if (gtk_widget_get_visible (self->priv->search_entry))
+ {
+ gtk_widget_grab_focus (self->priv->search_entry);
+ retval = TRUE;
+ }
break;
case GDK_KEY_Q:
case GDK_KEY_q:
g_object_unref (self);
retval = TRUE;
break;
+ case GDK_KEY_W:
+ case GDK_KEY_w:
+ if (gtk_notebook_get_current_page (GTK_NOTEBOOK (self->priv->notebook)) != OVERVIEW_PAGE)
+ shell_show_overview_page (self->priv);
+ retval = TRUE;
+ break;
}
}
return retval;
@@ -1098,7 +1094,6 @@
static void
gnome_control_center_init (GnomeControlCenter *self)
{
- GtkWidget *widget;
GError *err = NULL;
GnomeControlCenterPrivate *priv;
@@ -1123,20 +1118,17 @@
priv->notebook = W (priv->builder, "notebook");
priv->scrolled_window = W (priv->builder, "scrolledwindow1");
-
- widget = W (priv->builder, "viewport");
- g_signal_connect (widget, "style-set", G_CALLBACK (viewport_style_set_cb),
- NULL);
-
gtk_widget_set_size_request (priv->scrolled_window, FIXED_WIDTH, -1);
priv->main_vbox = W (priv->builder, "main-vbox");
- g_signal_connect (priv->scrolled_window, "size-allocate", G_CALLBACK (on_window_size_allocate), self);
g_signal_connect (priv->notebook, "switch-page",
G_CALLBACK (notebook_switch_page_cb), priv);
g_signal_connect (gtk_builder_get_object (priv->builder, "home-button"),
"clicked", G_CALLBACK (home_button_clicked_cb), self);
+ /* keep a list of custom widgets to unload on panel change */
+ priv->custom_widgets = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
+
/* load the available settings panels */
setup_model (self);
@@ -1151,6 +1143,8 @@
/* store default window title and name */
priv->default_window_title = g_strdup (gtk_window_get_title (GTK_WINDOW (priv->window)));
priv->default_window_icon = g_strdup (gtk_window_get_icon_name (GTK_WINDOW (priv->window)));
+
+ notebook_switch_page_cb (NULL, NULL, OVERVIEW_PAGE, priv);
}
GnomeControlCenter *
@@ -1170,5 +1164,5 @@
GtkApplication *app)
{
gtk_window_set_application (GTK_WINDOW (center->priv->window), app);
- gtk_widget_show_all (gtk_bin_get_child (GTK_BIN (center->priv->window)));
+ gtk_widget_show (gtk_bin_get_child (GTK_BIN (center->priv->window)));
}
Modified: trunk/control-center-gnome/src/cut-n-paste/shell/gnome-control-center.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cut-n-p…
==============================================================================
--- trunk/control-center-gnome/src/cut-n-paste/shell/gnome-control-center.h (original)
+++ trunk/control-center-gnome/src/cut-n-paste/shell/gnome-control-center.h Wed Jan 11 12:02:37 2012
@@ -22,7 +22,7 @@
#define _GNOME_CONTROL_CENTER_H
#include <glib-object.h>
-#include <libgnome-control-center/cc-shell.h>
+#include "cc-shell.h"
G_BEGIN_DECLS
Modified: trunk/control-center-gnome/src/cut-n-paste/shell/shell-search-renderer.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cut-n-p…
==============================================================================
--- trunk/control-center-gnome/src/cut-n-paste/shell/shell-search-renderer.c (original)
+++ trunk/control-center-gnome/src/cut-n-paste/shell/shell-search-renderer.c Wed Jan 11 12:02:37 2012
@@ -154,12 +154,15 @@
needle = g_utf8_casefold (priv->search_string, -1);
else
needle = NULL;
- haystack = g_utf8_casefold (full_string, -1);
+ if (full_string != NULL)
+ haystack = g_utf8_casefold (full_string, -1);
+ else
+ haystack = NULL;
/* clear any previous attributes */
pango_layout_set_attributes (priv->layout, NULL);
- if (priv->search_string && priv->title
+ if (priv->search_string && priv->search_target && priv->title
&& (strstr (haystack, needle)))
{
gchar *start;
Modified: trunk/control-center-gnome/src/cut-n-paste/shell/shell.ui
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cut-n-p…
==============================================================================
--- trunk/control-center-gnome/src/cut-n-paste/shell/shell.ui (original)
+++ trunk/control-center-gnome/src/cut-n-paste/shell/shell.ui Wed Jan 11 12:02:37 2012
@@ -35,11 +35,17 @@
<property name="visible">True</property>
<child>
<object class="GtkButton" id="home-button">
- <property name="label" translatable="yes">_All Settings</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="no_show_all">True</property>
<property name="use_underline">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="image">image1</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="home-button-atkobject">
+ <property name="AtkObject::accessible-name" translatable="yes">All Settings</property>
+ </object>
+ </child>
</object>
<packing>
<property name="expand">False</property>
@@ -170,4 +176,10 @@
<widget name="entry-alignment"/>
</widgets>
</object>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="icon_name">view-grid-symbolic</property>
+ <property name="use_fallback">True</property>
+ </object>
</interface>
Modified: trunk/control-center-gnome/src/gnome-control-center.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/gnome-c…
==============================================================================
--- trunk/control-center-gnome/src/gnome-control-center.c (original)
+++ trunk/control-center-gnome/src/gnome-control-center.c Wed Jan 11 12:02:37 2012
@@ -44,6 +44,14 @@
#define W(b,x) GTK_WIDGET (gtk_builder_get_object (b, x))
+/* Use a fixed width for the shell, since resizing horizontally is more awkward
+ * for the user than resizing vertically
+ * Both sizes are defined in https://live.gnome.org/Design/SystemSettings/ */
+#define FIXED_WIDTH 675
+#define FIXED_HEIGHT 530
+
+#define MIN_ICON_VIEW_HEIGHT 300
+
enum
{
OVERVIEW_PAGE,
@@ -61,6 +69,7 @@
GtkWidget *window;
GtkWidget *search_entry;
GtkWidget *lock_button;
+ GPtrArray *custom_widgets;
GMenuTree *menu_tree;
GtkListStore *store;
@@ -79,11 +88,6 @@
gchar *default_window_icon;
};
-/* Use a fixed width for the shell, since resizing horizontally is more awkward
- * for the user than resizing vertically */
-#define FIXED_WIDTH 675
-
-
#if 0
static const gchar *
get_icon_name_from_g_icon (GIcon *gicon)
@@ -111,6 +115,7 @@
static void
activate_panel (GnomeControlCenter *shell,
const gchar *id,
+ const gchar **argv,
const gchar *desktop_file,
const gchar *name,
GIcon *gicon)
@@ -180,7 +185,7 @@
const gchar *icon_name;
/* create the panel plugin */
- panel = g_object_new (panel_type, "shell", shell, NULL);
+ panel = g_object_new (panel_type, "shell", shell, "argv", argv, NULL);
gtk_lock_button_set_permission (GTK_LOCK_BUTTON (priv->lock_button),
cc_panel_get_permission (CC_PANEL (panel)));
@@ -207,7 +212,7 @@
/* set the scrolled window small so that it doesn't force
the window to be larger than this panel */
- gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (priv->scrolled_window), 50);
+ gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (priv->scrolled_window), MIN_ICON_VIEW_HEIGHT);
/* resize to the preferred size of the panel */
gtk_widget_set_size_request (priv->window, FIXED_WIDTH, -1);
@@ -227,6 +232,23 @@
}
static void
+_shell_remove_all_custom_widgets (GnomeControlCenterPrivate *priv)
+{
+ GtkBox *box;
+ GtkWidget *widget;
+ guint i;
+
+ /* remove from the header */
+ box = GTK_BOX (W (priv->builder, "topright"));
+ for (i = 0; i < priv->custom_widgets->len; i++)
+ {
+ widget = g_ptr_array_index (priv->custom_widgets, i);
+ gtk_container_remove (GTK_CONTAINER (box), widget);
+ }
+ g_ptr_array_set_size (priv->custom_widgets, 0);
+}
+
+static void
shell_show_overview_page (GnomeControlCenterPrivate *priv)
{
gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), OVERVIEW_PAGE);
@@ -237,6 +259,7 @@
g_free (priv->filter_string);
priv->filter_string = g_strdup ("");
gtk_entry_set_text (GTK_ENTRY (priv->search_entry), "");
+ gtk_widget_grab_focus (priv->search_entry);
gtk_lock_button_set_permission (GTK_LOCK_BUTTON (priv->lock_button), NULL);
@@ -245,6 +268,9 @@
gtk_window_set_default_icon_name (priv->default_window_icon);
gtk_window_set_icon_name (GTK_WINDOW (priv->window),
priv->default_window_icon);
+
+ /* clear any custom widgets */
+ _shell_remove_all_custom_widgets (priv);
}
void
@@ -262,7 +288,7 @@
{
GError *err = NULL;
- if (!cc_shell_set_active_panel_from_id (CC_SHELL (shell), id, &err))
+ if (!cc_shell_set_active_panel_from_id (CC_SHELL (shell), id, NULL, &err))
{
/* TODO: show message to user */
if (err)
@@ -586,6 +612,7 @@
setup_search (GnomeControlCenter *shell)
{
GtkWidget *search_scrolled, *search_view, *widget;
+ GtkCellRenderer *renderer;
GnomeControlCenterPrivate *priv = shell->priv;
g_return_if_fail (priv->store != NULL);
@@ -606,7 +633,15 @@
gtk_icon_view_set_spacing (GTK_ICON_VIEW (search_view), 6);
gtk_icon_view_set_model (GTK_ICON_VIEW (search_view),
GTK_TREE_MODEL (priv->search_filter));
- gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW (search_view), COL_PIXBUF);
+
+ renderer = gtk_cell_renderer_pixbuf_new ();
+ g_object_set (renderer,
+ "follow-state", TRUE,
+ NULL);
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (search_view),
+ renderer, FALSE);
+ gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (search_view), renderer,
+ "pixbuf", COL_PIXBUF);
search_scrolled = W (priv->builder, "search-scrolled-window");
gtk_container_add (GTK_CONTAINER (search_scrolled), search_view);
@@ -638,6 +673,8 @@
g_signal_connect (widget, "icon-release", G_CALLBACK (search_entry_clear_cb),
priv);
+
+ gtk_widget_show (priv->search_view);
}
static void
@@ -815,18 +852,35 @@
gtk_widget_hide (W (priv->builder, "home-button"));
gtk_widget_show (W (priv->builder, "search-entry"));
gtk_widget_hide (W (priv->builder, "lock-button"));
+ gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (priv->scrolled_window), FIXED_HEIGHT - 50);
}
else
{
gtk_widget_show (W (priv->builder, "home-button"));
gtk_widget_hide (W (priv->builder, "search-entry"));
+ gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (priv->scrolled_window), MIN_ICON_VIEW_HEIGHT);
}
}
/* CcShell implementation */
+static void
+_shell_embed_widget_in_header (CcShell *shell,
+ GtkWidget *widget)
+{
+ GnomeControlCenterPrivate *priv = GNOME_CONTROL_CENTER (shell)->priv;
+ GtkBox *box;
+
+ /* add to header */
+ box = GTK_BOX (W (priv->builder, "topright"));
+ gtk_box_pack_end (box, widget, FALSE, FALSE, 0);
+ g_ptr_array_add (priv->custom_widgets, g_object_ref (widget));
+}
+
+/* CcShell implementation */
static gboolean
_shell_set_active_panel_from_id (CcShell *shell,
const gchar *start_id,
+ const gchar **argv,
GError **err)
{
GtkTreeIter iter;
@@ -836,6 +890,8 @@
GIcon *gicon;
GnomeControlCenterPrivate *priv = GNOME_CONTROL_CENTER (shell)->priv;
+ /* clear any custom widgets */
+ _shell_remove_all_custom_widgets (priv);
iter_valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->store),
&iter);
@@ -882,8 +938,8 @@
{
gtk_notebook_remove_page (GTK_NOTEBOOK (priv->notebook), CAPPLET_PAGE);
- activate_panel (GNOME_CONTROL_CENTER (shell), start_id, desktop, name,
- gicon);
+ activate_panel (GNOME_CONTROL_CENTER (shell), start_id, argv, desktop,
+ name, gicon);
g_free (name);
g_free (desktop);
@@ -932,6 +988,11 @@
{
GnomeControlCenterPrivate *priv = GNOME_CONTROL_CENTER (object)->priv;
+ if (priv->custom_widgets)
+ {
+ g_ptr_array_unref (priv->custom_widgets);
+ priv->custom_widgets = NULL;
+ }
if (priv->window)
{
gtk_widget_destroy (priv->window);
@@ -1018,91 +1079,11 @@
object_class->finalize = gnome_control_center_finalize;
shell_class->set_active_panel_from_id = _shell_set_active_panel_from_id;
+ shell_class->embed_widget_in_header = _shell_embed_widget_in_header;
shell_class->get_toplevel = _shell_get_toplevel;
}
static gboolean
-queue_resize (gpointer data)
-{
- GtkWidget *widget = data;
-
- gtk_widget_queue_resize (widget);
-
- return FALSE;
-}
-
-static void
-on_window_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation,
- GnomeControlCenter *self)
-{
- int height;
-
- if (gtk_notebook_get_current_page (GTK_NOTEBOOK (self->priv->notebook)) == OVERVIEW_PAGE)
- {
- gtk_widget_get_preferred_height_for_width (GTK_WIDGET (self->priv->main_vbox),
- FIXED_WIDTH,
- NULL,
- &height);
- if (gtk_widget_get_realized (widget))
- {
- int monitor;
- GdkScreen *screen;
- GdkRectangle rect;
- GdkWindow *window;
-
- window = gtk_widget_get_window (widget);
- screen = gtk_widget_get_screen (widget);
- monitor = gdk_screen_get_monitor_at_window (screen, window);
- gdk_screen_get_monitor_geometry (screen, monitor, &rect);
- height = (rect.height * 3) / 5;
- } else {
- int monitor;
- GdkScreen *screen;
- GdkRectangle rect;
-
- screen = gdk_screen_get_default ();
- monitor = gdk_screen_get_primary_monitor (screen);
- gdk_screen_get_monitor_geometry (screen, monitor, &rect);
- height = (rect.height * 3) / 5;
- }
- }
- else
- {
- height = 50;
- }
-
- if (gtk_scrolled_window_get_min_content_height (GTK_SCROLLED_WINDOW (self->priv->scrolled_window)) != height)
- {
- gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (self->priv->scrolled_window), height);
- /*
- * Queueing a resize out of size-allocate is ignored,
- * so we have to defer to an idle.
- */
- g_idle_add (queue_resize, self->priv->scrolled_window);
- }
-}
-
-static void
-viewport_style_set_cb (GtkWidget *widget,
- GtkStyle *old_style,
- gpointer user_data)
-{
- GtkStyle *style;
-
- /* use "base" colours inside the viewport */
-
- g_signal_handlers_block_by_func (widget, viewport_style_set_cb, NULL);
-
- style = gtk_widget_get_style (widget);
-
- gtk_widget_modify_bg (widget, GTK_STATE_NORMAL,
- &style->base[GTK_STATE_NORMAL]);
-
- g_signal_handlers_unblock_by_func (widget, viewport_style_set_cb, NULL);
-}
-
-static gboolean
window_key_press_event (GtkWidget *win,
GdkEventKey *event,
GnomeControlCenter *self)
@@ -1111,9 +1092,6 @@
retval = FALSE;
- if (!gtk_widget_get_visible (self->priv->search_entry))
- return retval;
-
if (event->state != 0 &&
(event->state & GDK_CONTROL_MASK))
{
@@ -1123,14 +1101,23 @@
case GDK_KEY_S:
case GDK_KEY_f:
case GDK_KEY_F:
- gtk_widget_grab_focus (self->priv->search_entry);
- retval = TRUE;
+ if (gtk_widget_get_visible (self->priv->search_entry))
+ {
+ gtk_widget_grab_focus (self->priv->search_entry);
+ retval = TRUE;
+ }
break;
case GDK_KEY_Q:
case GDK_KEY_q:
g_object_unref (self);
retval = TRUE;
break;
+ case GDK_KEY_W:
+ case GDK_KEY_w:
+ if (gtk_notebook_get_current_page (GTK_NOTEBOOK (self->priv->notebook)) != OVERVIEW_PAGE)
+ shell_show_overview_page (self->priv);
+ retval = TRUE;
+ break;
}
}
return retval;
@@ -1139,7 +1126,6 @@
static void
gnome_control_center_init (GnomeControlCenter *self)
{
- GtkWidget *widget;
GError *err = NULL;
GnomeControlCenterPrivate *priv;
@@ -1164,20 +1150,17 @@
priv->notebook = W (priv->builder, "notebook");
priv->scrolled_window = W (priv->builder, "scrolledwindow1");
-
- widget = W (priv->builder, "viewport");
- g_signal_connect (widget, "style-set", G_CALLBACK (viewport_style_set_cb),
- NULL);
-
gtk_widget_set_size_request (priv->scrolled_window, FIXED_WIDTH, -1);
priv->main_vbox = W (priv->builder, "main-vbox");
- g_signal_connect (priv->scrolled_window, "size-allocate", G_CALLBACK (on_window_size_allocate), self);
g_signal_connect (priv->notebook, "switch-page",
G_CALLBACK (notebook_switch_page_cb), priv);
g_signal_connect (gtk_builder_get_object (priv->builder, "home-button"),
"clicked", G_CALLBACK (home_button_clicked_cb), self);
+ /* keep a list of custom widgets to unload on panel change */
+ priv->custom_widgets = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
+
/* load the available settings panels */
setup_model (self);
@@ -1192,6 +1175,8 @@
/* store default window title and name */
priv->default_window_title = g_strdup (gtk_window_get_title (GTK_WINDOW (priv->window)));
priv->default_window_icon = g_strdup (gtk_window_get_icon_name (GTK_WINDOW (priv->window)));
+
+ notebook_switch_page_cb (NULL, NULL, OVERVIEW_PAGE, priv);
}
GnomeControlCenter *
@@ -1211,5 +1196,5 @@
GtkApplication *app)
{
gtk_window_set_application (GTK_WINDOW (center->priv->window), app);
- gtk_widget_show_all (gtk_bin_get_child (GTK_BIN (center->priv->window)));
+ gtk_widget_show (gtk_bin_get_child (GTK_BIN (center->priv->window)));
}
Modified: trunk/control-center-gnome/src/patch/gnome-control-center.patch
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/patch/g…
==============================================================================
--- trunk/control-center-gnome/src/patch/gnome-control-center.patch (original)
+++ trunk/control-center-gnome/src/patch/gnome-control-center.patch Wed Jan 11 12:02:37 2012
@@ -1,5 +1,5 @@
---- ./patch/../cut-n-paste/shell/control-center.c 2011-09-02 15:37:12.959904219 +0200
-+++ ./patch/../control-center.c 2011-09-02 15:37:53.787529299 +0200
+--- patch/../cut-n-paste/shell/control-center.c 2012-01-11 11:20:37.282537770 +0100
++++ patch/../control-center.c 2012-01-11 11:30:21.628862207 +0100
@@ -28,7 +28,9 @@
#include <gtk/gtk.h>
@@ -64,7 +64,7 @@
if (show_overview)
{
gnome_control_center_set_overview_page (shell);
-@@ -139,17 +152,20 @@
+@@ -144,17 +157,20 @@
}
}
}
@@ -85,7 +85,7 @@
return retval;
}
-@@ -170,6 +186,8 @@
+@@ -175,6 +191,8 @@
GtkApplication *application;
int status;
@@ -94,7 +94,7 @@
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
-@@ -179,15 +197,21 @@
+@@ -182,15 +200,21 @@
gtk_init (&argc, &argv);
cc_shell_log_init ();
@@ -117,17 +117,17 @@
g_signal_connect (application, "startup",
G_CALLBACK (application_startup_cb), shell);
g_signal_connect (application, "command-line",
---- ./patch/../cut-n-paste/shell/gnome-control-center.c 2011-09-02 15:53:29.624723757 +0200
-+++ ./patch/../gnome-control-center.c 2011-09-02 16:02:55.176284577 +0200
-@@ -84,6 +84,7 @@
- #define FIXED_WIDTH 675
-
+--- patch/../cut-n-paste/shell/gnome-control-center.c 2012-01-11 11:23:37.375788585 +0100
++++ patch/../gnome-control-center.c 2012-01-11 11:30:21.630862187 +0100
+@@ -88,6 +88,7 @@
+ gchar *default_window_icon;
+ };
+#if 0
static const gchar *
get_icon_name_from_g_icon (GIcon *gicon)
{
-@@ -105,6 +106,7 @@
+@@ -109,6 +110,7 @@
return NULL;
}
@@ -135,7 +135,7 @@
static void
activate_panel (GnomeControlCenter *shell,
-@@ -113,6 +115,33 @@
+@@ -118,6 +120,33 @@
const gchar *name,
GIcon *gicon)
{
@@ -169,7 +169,7 @@
GnomeControlCenterPrivate *priv = shell->priv;
GType panel_type = G_TYPE_INVALID;
GList *panels, *l;
-@@ -194,6 +223,7 @@
+@@ -199,6 +228,7 @@
g_warning ("Could not find the loadable module for panel '%s'", id);
}
}
@@ -177,7 +177,7 @@
}
static void
-@@ -732,7 +762,7 @@
+@@ -769,7 +799,7 @@
priv->store = (GtkListStore *) cc_shell_model_new ();
priv->category_views = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
@@ -186,7 +186,7 @@
reload_menu (shell);
-@@ -742,6 +772,7 @@
+@@ -779,6 +809,7 @@
static void
load_panel_plugins (GnomeControlCenter *shell)
{
@@ -194,7 +194,7 @@
GList *modules;
/* only allow this function to be run once to prevent modules being loaded
-@@ -760,6 +791,7 @@
+@@ -797,6 +828,7 @@
modules = g_io_modules_load_all_in_directory (PANELS_DIR);
g_list_free (modules);
@@ -202,41 +202,8 @@
}
-@@ -1023,7 +1055,16 @@
- screen = gtk_widget_get_screen (widget);
- monitor = gdk_screen_get_monitor_at_window (screen, window);
- gdk_screen_get_monitor_geometry (screen, monitor, &rect);
-- height = MIN (height + 10, rect.height - 120);
-+ height = (rect.height * 3) / 5;
-+ } else {
-+ int monitor;
-+ GdkScreen *screen;
-+ GdkRectangle rect;
-+
-+ screen = gdk_screen_get_default ();
-+ monitor = gdk_screen_get_primary_monitor (screen);
-+ gdk_screen_get_monitor_geometry (screen, monitor, &rect);
-+ height = (rect.height * 3) / 5;
- }
- }
- else
---- ./patch/../cut-n-paste/shell/shell-search-renderer.c 2011-09-02 16:14:13.066818949 +0200
-+++ ./patch/../shell-search-renderer.c 2011-09-02 16:16:56.262269091 +0200
-@@ -154,7 +154,11 @@
- needle = g_utf8_casefold (priv->search_string, -1);
- else
- needle = NULL;
-- haystack = g_utf8_casefold (full_string, -1);
-+ /* Fix crash caused by empty comments in yast .desktop files */
-+ if (full_string)
-+ haystack = g_utf8_casefold (full_string, -1);
-+ else
-+ haystack = g_strdup ("");
-
- /* clear any previous attributes */
- pango_layout_set_attributes (priv->layout, NULL);
---- ./patch/../cut-n-paste/shell/shell.ui 2011-07-25 12:13:00.915871481 +0200
-+++ ./patch/../shell.ui 2011-07-25 10:04:29.790594605 +0200
+--- patch/../cut-n-paste/shell/shell.ui 2012-01-11 11:23:19.550961711 +0100
++++ patch/../shell.ui 2012-01-11 11:27:45.688376803 +0100
@@ -3,9 +3,9 @@
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide -->
Modified: trunk/control-center-gnome/src/patch/update-patch.sh
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/patch/u…
==============================================================================
--- trunk/control-center-gnome/src/patch/update-patch.sh (original)
+++ trunk/control-center-gnome/src/patch/update-patch.sh Wed Jan 11 12:02:37 2012
@@ -1,7 +1,7 @@
#!/bin/sh
DIRNAME=`dirname $0`
(
-for file in control-center.c gnome-control-center.c shell-search-renderer.c shell.ui; do
+for file in control-center.c gnome-control-center.c shell.ui; do
diff -u "${DIRNAME}/../cut-n-paste/shell/$file" "${DIRNAME}/../$file"
done
) > "${DIRNAME}/gnome-control-center.patch"
Modified: trunk/control-center-gnome/src/shell.ui
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/shell.u…
==============================================================================
--- trunk/control-center-gnome/src/shell.ui (original)
+++ trunk/control-center-gnome/src/shell.ui Wed Jan 11 12:02:37 2012
@@ -35,11 +35,17 @@
<property name="visible">True</property>
<child>
<object class="GtkButton" id="home-button">
- <property name="label" translatable="yes">_All Settings</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="no_show_all">True</property>
<property name="use_underline">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="image">image1</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="home-button-atkobject">
+ <property name="AtkObject::accessible-name" translatable="yes">All Settings</property>
+ </object>
+ </child>
</object>
<packing>
<property name="expand">False</property>
@@ -170,4 +176,10 @@
<widget name="entry-alignment"/>
</widgets>
</object>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="icon_name">view-grid-symbolic</property>
+ <property name="use_fallback">True</property>
+ </object>
</interface>
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r67142 - in /trunk/audit-laf: COPYING.GPL2 yast2-audit-laf.spec.in
by gs@svn2.opensuse.org 11 Jan '12
by gs@svn2.opensuse.org 11 Jan '12
11 Jan '12
Author: gs
Date: Wed Jan 11 11:20:32 2012
New Revision: 67142
URL: http://svn.opensuse.org/viewcvs/yast?rev=67142&view=rev
Log:
COPYING.GPL2 not needed here, COPYING file is added
from devtools
Removed:
trunk/audit-laf/COPYING.GPL2
Modified:
trunk/audit-laf/yast2-audit-laf.spec.in
Modified: trunk/audit-laf/yast2-audit-laf.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/yast2-audit-laf.spec.i…
==============================================================================
--- trunk/audit-laf/yast2-audit-laf.spec.in (original)
+++ trunk/audit-laf/yast2-audit-laf.spec.in Wed Jan 11 11:20:32 2012
@@ -37,5 +37,7 @@
%dir @scrconfdir@
@scrconfdir@/auditd.scr
%doc @docdir@
-%doc COPYING.GPL2
+%doc COPYING
@schemadir@/autoyast/rnc/audit-laf.rnc
+%changelog
+
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
11 Jan '12
Author: jsuchome
Date: Wed Jan 11 10:59:02 2012
New Revision: 67141
URL: http://svn.opensuse.org/viewcvs/yast?rev=67141&view=rev
Log:
Created tag stable-2_22_0 for add-on-creator
Added:
tags/stable-2_22_0/add-on-creator/
- copied from r67140, trunk/add-on-creator/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r67140 - in /trunk/add-on-creator: ./ package/ src/
by jsuchome@svn2.opensuse.org 11 Jan '12
by jsuchome@svn2.opensuse.org 11 Jan '12
11 Jan '12
Author: jsuchome
Date: Wed Jan 11 10:58:38 2012
New Revision: 67140
URL: http://svn.opensuse.org/viewcvs/yast?rev=67140&view=rev
Log:
- Confirmed license
- 2.22.0
Modified:
trunk/add-on-creator/VERSION
trunk/add-on-creator/package/yast2-add-on-creator.changes
trunk/add-on-creator/src/AddOnCreator.ycp
trunk/add-on-creator/src/add-on-creator.ycp
trunk/add-on-creator/src/complex.ycp
trunk/add-on-creator/src/dialogs.ycp
trunk/add-on-creator/src/helps.ycp
trunk/add-on-creator/src/patterns.ycp
trunk/add-on-creator/src/wizards.ycp
trunk/add-on-creator/yast2-add-on-creator.spec.in
Modified: trunk/add-on-creator/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on-creator/VERSION?rev=67140…
==============================================================================
--- trunk/add-on-creator/VERSION (original)
+++ trunk/add-on-creator/VERSION Wed Jan 11 10:58:38 2012
@@ -1 +1 @@
-2.21.2
+2.22.0
Modified: trunk/add-on-creator/package/yast2-add-on-creator.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on-creator/package/yast2-add…
==============================================================================
--- trunk/add-on-creator/package/yast2-add-on-creator.changes (original)
+++ trunk/add-on-creator/package/yast2-add-on-creator.changes Wed Jan 11 10:58:38 2012
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Wed Jan 11 10:26:12 CET 2012 - jsuchome(a)suse.cz
+
+- Confirmed license
+- 2.22.0
+
+-------------------------------------------------------------------
Wed Dec 7 10:05:46 UTC 2011 - coolo(a)suse.com
- fix license to be in spdx.org format
Modified: trunk/add-on-creator/src/AddOnCreator.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on-creator/src/AddOnCreator.…
==============================================================================
--- trunk/add-on-creator/src/AddOnCreator.ycp (original)
+++ trunk/add-on-creator/src/AddOnCreator.ycp Wed Jan 11 10:58:38 2012
@@ -1,5 +1,5 @@
/* ------------------------------------------------------------------------------
- * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ * Copyright (c) 2006-2012 Novell, Inc. All Rights Reserved.
*
*
* This program is free software; you can redistribute it and/or modify it under
Modified: trunk/add-on-creator/src/add-on-creator.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on-creator/src/add-on-creato…
==============================================================================
--- trunk/add-on-creator/src/add-on-creator.ycp (original)
+++ trunk/add-on-creator/src/add-on-creator.ycp Wed Jan 11 10:58:38 2012
@@ -1,5 +1,5 @@
/* ------------------------------------------------------------------------------
- * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ * Copyright (c) 2006-2012 Novell, Inc. All Rights Reserved.
*
*
* This program is free software; you can redistribute it and/or modify it under
Modified: trunk/add-on-creator/src/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on-creator/src/complex.ycp?r…
==============================================================================
--- trunk/add-on-creator/src/complex.ycp (original)
+++ trunk/add-on-creator/src/complex.ycp Wed Jan 11 10:58:38 2012
@@ -1,5 +1,5 @@
/* ------------------------------------------------------------------------------
- * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ * Copyright (c) 2006-2012 Novell, Inc. All Rights Reserved.
*
*
* This program is free software; you can redistribute it and/or modify it under
Modified: trunk/add-on-creator/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on-creator/src/dialogs.ycp?r…
==============================================================================
--- trunk/add-on-creator/src/dialogs.ycp (original)
+++ trunk/add-on-creator/src/dialogs.ycp Wed Jan 11 10:58:38 2012
@@ -1,5 +1,5 @@
/* ------------------------------------------------------------------------------
- * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ * Copyright (c) 2006-2012 Novell, Inc. All Rights Reserved.
*
*
* This program is free software; you can redistribute it and/or modify it under
Modified: trunk/add-on-creator/src/helps.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on-creator/src/helps.ycp?rev…
==============================================================================
--- trunk/add-on-creator/src/helps.ycp (original)
+++ trunk/add-on-creator/src/helps.ycp Wed Jan 11 10:58:38 2012
@@ -1,5 +1,5 @@
/* ------------------------------------------------------------------------------
- * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ * Copyright (c) 2006-2012 Novell, Inc. All Rights Reserved.
*
*
* This program is free software; you can redistribute it and/or modify it under
Modified: trunk/add-on-creator/src/patterns.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on-creator/src/patterns.ycp?…
==============================================================================
--- trunk/add-on-creator/src/patterns.ycp (original)
+++ trunk/add-on-creator/src/patterns.ycp Wed Jan 11 10:58:38 2012
@@ -1,3 +1,23 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006-2012 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
/**
* File: include/add-on-creator/patterns.ycp
* Package: Add-On Creator
Modified: trunk/add-on-creator/src/wizards.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on-creator/src/wizards.ycp?r…
==============================================================================
--- trunk/add-on-creator/src/wizards.ycp (original)
+++ trunk/add-on-creator/src/wizards.ycp Wed Jan 11 10:58:38 2012
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ * Copyright (c) 2006-2012 Novell, Inc. All Rights Reserved.
*
*
* This program is free software; you can redistribute it and/or modify it under
Modified: trunk/add-on-creator/yast2-add-on-creator.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on-creator/yast2-add-on-crea…
==============================================================================
--- trunk/add-on-creator/yast2-add-on-creator.spec.in (original)
+++ trunk/add-on-creator/yast2-add-on-creator.spec.in Wed Jan 11 10:58:38 2012
@@ -2,7 +2,7 @@
@HEADER@
Group: System/YaST
-License: GPL-2.0 ; GPL-2.0+
+License: GPL-2.0
PreReq: %fillup_prereq
Requires: yast2 >= 2.21.22
BuildRequires: perl-XML-Writer update-desktop-files yast2 yast2-devtools yast2-testsuite
@@ -39,4 +39,5 @@
@scrconfdir@/*.scr
@agentdir@/ag_*
%doc @docdir@
+%doc COPYING
/var/adm/fillup-templates/sysconfig.add-on-creator
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r67139 - in /trunk/storage: package/yast2-storage.changes storage/src/modules/Storage.ycp
by fehr@svn2.opensuse.org 10 Jan '12
by fehr@svn2.opensuse.org 10 Jan '12
10 Jan '12
Author: fehr
Date: Tue Jan 10 19:01:40 2012
New Revision: 67139
URL: http://svn.opensuse.org/viewcvs/yast?rev=67139&view=rev
Log:
fix parsing problem with old style size values (e.g. 10G instead of 10GB) (bnc#740560)
Modified:
trunk/storage/package/yast2-storage.changes
trunk/storage/storage/src/modules/Storage.ycp
Modified: trunk/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.ch…
==============================================================================
--- trunk/storage/package/yast2-storage.changes (original)
+++ trunk/storage/package/yast2-storage.changes Tue Jan 10 19:01:40 2012
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Tue Jan 10 18:59:52 CET 2012 - fehr(a)suse.de
+
+- fix parsing problem with old style size values (e.g. 10G instead
+ of 10GB) (bnc#740560)
+
+-------------------------------------------------------------------
Mon Jan 9 16:39:46 CET 2012 - fehr(a)suse.de
- fix missing /boot partition in proposal (bnc#739091)
Modified: trunk/storage/storage/src/modules/Storage.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Stor…
==============================================================================
--- trunk/storage/storage/src/modules/Storage.ycp (original)
+++ trunk/storage/storage/src/modules/Storage.ycp Tue Jan 10 19:01:40 2012
@@ -397,7 +397,11 @@
{
integer bytes = 0;
if (!LibStorage::humanStringToByte(str, true, bytes))
- y2error("cannot parse %1", str);
+ {
+ string ts = str+"b";
+ if( !LibStorage::humanStringToByte(ts, true, bytes))
+ y2error("cannot parse %1 or %2", str, ts);
+ }
return bytes;
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r67138 - in /branches/SuSE-Code-11-SP2-Branch/storage: package/yast2-storage.changes storage/src/modules/Storage.ycp
by fehr@svn2.opensuse.org 10 Jan '12
by fehr@svn2.opensuse.org 10 Jan '12
10 Jan '12
Author: fehr
Date: Tue Jan 10 19:00:30 2012
New Revision: 67138
URL: http://svn.opensuse.org/viewcvs/yast?rev=67138&view=rev
Log:
fix parsing problem with old style size values (e.g. 10G instead of 10GB) (bnc#740560)
Modified:
branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes
branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp
Modified: branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes (original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes Tue Jan 10 19:00:30 2012
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Tue Jan 10 18:59:52 CET 2012 - fehr(a)suse.de
+
+- fix parsing problem with old style size values (e.g. 10G instead
+ of 10GB) (bnc#740560)
+
+-------------------------------------------------------------------
Mon Jan 9 17:15:30 CET 2012 - fehr(a)suse.de
- fix missing /boot partition in proposal (bnc#739091)
Modified: branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp Tue Jan 10 19:00:30 2012
@@ -397,7 +397,11 @@
{
integer bytes = 0;
if (!LibStorage::humanStringToByte(str, true, bytes))
- y2error("cannot parse %1", str);
+ {
+ string ts = str+"b";
+ if( !LibStorage::humanStringToByte(ts, true, bytes))
+ y2error("cannot parse %1 or %2", str, ts);
+ }
return bytes;
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r67137 - in /trunk/autoinstallation: doc/xml/Installation.xml package/autoyast2.changes
by ug@svn2.opensuse.org 10 Jan '12
by ug@svn2.opensuse.org 10 Jan '12
10 Jan '12
Author: ug
Date: Tue Jan 10 15:36:56 2012
New Revision: 67137
URL: http://svn.opensuse.org/viewcvs/yast?rev=67137&view=rev
Log:
typos fixed
Modified:
trunk/autoinstallation/doc/xml/Installation.xml
trunk/autoinstallation/package/autoyast2.changes
Modified: trunk/autoinstallation/doc/xml/Installation.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/doc/xml/Install…
==============================================================================
--- trunk/autoinstallation/doc/xml/Installation.xml (original)
+++ trunk/autoinstallation/doc/xml/Installation.xml Tue Jan 10 15:36:56 2012
@@ -656,7 +656,7 @@
</para>
<example>
<title>
- Linxurc options in the control file
+ Linuxrc options in the control file
</title>
<screen><![CDATA[....
<install>
Modified: trunk/autoinstallation/package/autoyast2.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/package/autoyas…
==============================================================================
--- trunk/autoinstallation/package/autoyast2.changes (original)
+++ trunk/autoinstallation/package/autoyast2.changes Tue Jan 10 15:36:56 2012
@@ -1,7 +1,7 @@
-------------------------------------------------------------------
Wed Jan 4 15:51:41 CET 2012 - ug(a)suse.de
-- added taboo list for device guessing added
+- added taboo list for device guessing
(bnc#736530)
-------------------------------------------------------------------
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0