YaST Commits
Threads by month
- ----- 2024 -----
- 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
July 2011
- 19 participants
- 410 discussions
Author: locilka
Date: Mon Jul 25 14:15:39 2011
New Revision: 64983
URL: http://svn.opensuse.org/viewcvs/yast?rev=64983&view=rev
Log:
Created tag stable-0_8_12
Added:
tags/stable-0_8_12/
--
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] r64982 - in /trunk/metapackage: VERSION package/yast2-metapackage-handler.changes
by locilka@svn2.opensuse.org 25 Jul '11
by locilka@svn2.opensuse.org 25 Jul '11
25 Jul '11
Author: locilka
Date: Mon Jul 25 14:15:28 2011
New Revision: 64982
URL: http://svn.opensuse.org/viewcvs/yast?rev=64982&view=rev
Log:
New version
Modified:
trunk/metapackage/VERSION
trunk/metapackage/package/yast2-metapackage-handler.changes
Modified: trunk/metapackage/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/metapackage/VERSION?rev=64982&r1…
==============================================================================
--- trunk/metapackage/VERSION (original)
+++ trunk/metapackage/VERSION Mon Jul 25 14:15:28 2011
@@ -1 +1 @@
-0.8.11
+0.8.12
Modified: trunk/metapackage/package/yast2-metapackage-handler.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/metapackage/package/yast2-metapa…
==============================================================================
--- trunk/metapackage/package/yast2-metapackage-handler.changes (original)
+++ trunk/metapackage/package/yast2-metapackage-handler.changes Mon Jul 25 14:15:28 2011
@@ -3,6 +3,7 @@
- removed X-KDE-SubstituteUID from the desktop file and replaced
with X-SuSE-YaST-RootOnly (bnc#540627)
+- 0.8.12
-------------------------------------------------------------------
Fri Oct 15 11:34:00 UTC 2010 - lslezak(a)suse.cz
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
25 Jul '11
Author: lslezak
Date: Mon Jul 25 13:33:28 2011
New Revision: 64981
URL: http://svn.opensuse.org/viewcvs/yast?rev=64981&view=rev
Log:
Created tag stable-2_21_6 for packager
Added:
tags/stable-2_21_6/packager/ (props changed)
- copied from r64980, trunk/packager/
--
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] r64980 - in /trunk/packager: VERSION package/yast2-packager.changes src/config/ src/config/webpin.desktop
by lslezak@svn2.opensuse.org 25 Jul '11
by lslezak@svn2.opensuse.org 25 Jul '11
25 Jul '11
Author: lslezak
Date: Mon Jul 25 13:33:21 2011
New Revision: 64980
URL: http://svn.opensuse.org/viewcvs/yast?rev=64980&view=rev
Log:
- removed trailing white space in webpin.desktop file (bnc#707984)
- 2.21.6
Modified:
trunk/packager/VERSION
trunk/packager/package/yast2-packager.changes
trunk/packager/src/config/ (props changed)
trunk/packager/src/config/webpin.desktop
Modified: trunk/packager/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/VERSION?rev=64980&r1=64…
==============================================================================
--- trunk/packager/VERSION (original)
+++ trunk/packager/VERSION Mon Jul 25 13:33:21 2011
@@ -1 +1 @@
-2.21.5
+2.21.6
Modified: trunk/packager/package/yast2-packager.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/package/yast2-packager.…
==============================================================================
--- trunk/packager/package/yast2-packager.changes (original)
+++ trunk/packager/package/yast2-packager.changes Mon Jul 25 13:33:21 2011
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Mon Jul 25 11:22:05 UTC 2011 - lslezak(a)suse.cz
+
+- removed trailing white space in webpin.desktop file (bnc#707984)
+- 2.21.6
+
+-------------------------------------------------------------------
Fri Jul 22 15:09:22 CEST 2011 - locilka(a)suse.cz
- Removed obsoleted X-KDE-SubstituteUID from desktop file
Modified: trunk/packager/src/config/webpin.desktop
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/config/webpin.deskt…
==============================================================================
--- trunk/packager/src/config/webpin.desktop (original)
+++ trunk/packager/src/config/webpin.desktop Mon Jul 25 13:33:21 2011
@@ -16,9 +16,9 @@
X-SuSE-YaST-SortKey=
X-SuSE-YaST-AutoInstResource=
-Icon=yast-webpin
+Icon=yast-webpin
Exec=xdg-su -c "/sbin/yast2 webpin_package_search"
Name=Package Search (webpin)
-GenericName=Search for software in online repositories
+GenericName=Search for software in online repositories
StartupNotify=true
--
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] r64979 - in /trunk/control-center-gnome: ./ etc/ src/
by vuntz@svn2.opensuse.org 25 Jul '11
by vuntz@svn2.opensuse.org 25 Jul '11
25 Jul '11
Author: vuntz
Date: Mon Jul 25 12:21:36 2011
New Revision: 64979
URL: http://svn.opensuse.org/viewcvs/yast?rev=64979&view=rev
Log:
2011-07-25 Vincent Untz <vuntz(a)gnome.org>
Release 2.21.0
Completely rewrite: this is now a fork of the shell of
gnome-control-center in GNOME 3. The code should be kept in sync with
the upstream code; gnome-control-center.patch can be used as a basis for
this.
* VERSION: bump version.
* gnome-control-center.patch: patch that is applied to the
gnome-control-center shell to get the code in src/.
* configure.in.in: update dependencies (gconf-2.0, libslab, unique-1.0
are gone, we now depend on gio-unix-2.0, gtk+-3.0,
libgnome-control-center, libgnome-menu).
* etc/yast2-control-center-gnome.schemas.in, etc/Makefile.am: drop gconf
schema, since we don't use it anymore.
* src/*: everything is changed.
Added:
trunk/control-center-gnome/gnome-control-center.patch
trunk/control-center-gnome/src/cc-shell-category-view.c
trunk/control-center-gnome/src/cc-shell-category-view.h
trunk/control-center-gnome/src/cc-shell-item-view.c
trunk/control-center-gnome/src/cc-shell-item-view.h
trunk/control-center-gnome/src/cc-shell-log.c
trunk/control-center-gnome/src/cc-shell-log.h
trunk/control-center-gnome/src/cc-shell-marshal.list
trunk/control-center-gnome/src/cc-shell-model.c
trunk/control-center-gnome/src/cc-shell-model.h
trunk/control-center-gnome/src/gnome-control-center.c
trunk/control-center-gnome/src/gnome-control-center.h
trunk/control-center-gnome/src/shell-search-renderer.c
trunk/control-center-gnome/src/shell-search-renderer.h
trunk/control-center-gnome/src/shell.ui
Removed:
trunk/control-center-gnome/etc/yast2-control-center-gnome.schemas.in
Modified:
trunk/control-center-gnome/ChangeLog
trunk/control-center-gnome/VERSION
trunk/control-center-gnome/configure.in.in
trunk/control-center-gnome/etc/Makefile.am
trunk/control-center-gnome/src/Makefile.am
trunk/control-center-gnome/src/control-center.c
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 Mon Jul 25 12:21:36 2011
@@ -1,3 +1,22 @@
+2011-07-25 Vincent Untz <vuntz(a)gnome.org>
+
+ Release 2.21.0
+
+ Completely rewrite: this is now a fork of the shell of
+ gnome-control-center in GNOME 3. The code should be kept in sync with
+ the upstream code; gnome-control-center.patch can be used as a basis for
+ this.
+
+ * VERSION: bump version.
+ * gnome-control-center.patch: patch that is applied to the
+ gnome-control-center shell to get the code in src/.
+ * configure.in.in: update dependencies (gconf-2.0, libslab, unique-1.0
+ are gone, we now depend on gio-unix-2.0, gtk+-3.0,
+ libgnome-control-center, libgnome-menu).
+ * etc/yast2-control-center-gnome.schemas.in, etc/Makefile.am: drop gconf
+ schema, since we don't use it anymore.
+ * src/*: everything is changed.
+
2010-03-28 Cong Meng <cmeng(a)novell.com>
Add a new category High Availability. (bnc #575787)
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 Mon Jul 25 12:21:36 2011
@@ -1 +1 @@
-2.13.4
+2.21.0
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 Mon Jul 25 12:21:36 2011
@@ -11,19 +11,17 @@
dnl ==============================================
dnl Check that we meet the dependencies
dnl ==============================================
-AM_PATH_GLIB_2_0(2.8.0,,,gobject)
+AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal, no)
-PKG_CHECK_MODULES(CONTROL, libslab >= 2.27.1 unique-1.0)
-AC_SUBST(CONTROL_CFLAGS)
-AC_SUBST(CONTROL_LIBS)
-
-AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
-
-if test x"$GCONFTOOL" = xno; then
- AC_MSG_ERROR([gconftool-2 executable was not found in your path - should be install with gconf])
+if test x"$GLIB_GENMARSHAL" = xno; then
+ AC_MSG_ERROR([glib-genmarshal executable not found in your path - should be installed with glib])
fi
-AM_GCONF_SOURCE_2
+AC_SUBST(GLIB_GENMARSHAL)
+
+PKG_CHECK_MODULES(CONTROL, gtk+-3.0 libgnome-menu gio-unix-2.0 libgnome-control-center > 3.0)
+AC_SUBST(CONTROL_CFLAGS)
+AC_SUBST(CONTROL_LIBS)
## and generate the output
@YAST2-OUTPUT@
Modified: trunk/control-center-gnome/etc/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/etc/Makefil…
==============================================================================
--- trunk/control-center-gnome/etc/Makefile.am (original)
+++ trunk/control-center-gnome/etc/Makefile.am Mon Jul 25 12:21:36 2011
@@ -1,6 +1,3 @@
-schemasdir = @GCONF_SCHEMA_FILE_DIR@
-schemas_DATA = yast2-control-center-gnome.schemas
-
# hacks
menudir = $(sysconfdir)/xdg/menus
menu_DATA = YaST-gnome.menu
@@ -9,16 +6,4 @@
directorydir = $(datadir)/desktop-directories
directory_DATA = $(wildcard yast-gnome-*.directory)
-$(schemas_DATA): $(schemas_DATA).in
- sed -e "s|\@DATADIR\@|$(datadir)|g" $< > $@
-
-install-data-local:
- if test -z "$(DESTDIR)" ; then \
- for p in $(schemas_DATA) ; do \
- GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $$p; \
- done \
- fi
-
-EXTRA_DIST = $(schemas_DATA).in $(menu_DATA) $(directory_DATA)
-
-CLEANFILES = $(schemas_DATA)
+EXTRA_DIST = $(menu_DATA) $(directory_DATA)
Added: trunk/control-center-gnome/gnome-control-center.patch
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/gnome-contr…
==============================================================================
--- trunk/control-center-gnome/gnome-control-center.patch (added)
+++ trunk/control-center-gnome/gnome-control-center.patch Mon Jul 25 12:21:36 2011
@@ -0,0 +1,243 @@
+commit 9515576b680d86c78f5c5e100b22c0e71e71b738
+Author: Vincent Untz <vuntz(a)gnome.org>
+Date: Mon Jul 25 11:38:26 2011 +0200
+
+ shell: change to YaST shell
+
+diff --git a/shell/cc-shell-category-view.c b/shell/cc-shell-category-view.c
+index b2a5ee4..57ad8d4 100644
+--- a/shell/cc-shell-category-view.c
++++ b/shell/cc-shell-category-view.c
+@@ -20,7 +20,7 @@
+
+ #include "cc-shell-category-view.h"
+ #include "cc-shell-item-view.h"
+-#include "cc-shell.h"
++#include <libgnome-control-center/cc-shell.h>
+ #include "cc-shell-model.h"
+
+ G_DEFINE_TYPE (CcShellCategoryView, cc_shell_category_view, GTK_TYPE_FRAME)
+diff --git a/shell/control-center.c b/shell/control-center.c
+index 2ba41fd..09aec0f 100644
+--- a/shell/control-center.c
++++ b/shell/control-center.c
+@@ -41,8 +41,10 @@ option_version_cb (const gchar *option_name,
+ exit (0);
+ }
+
++#if 0
+ static char **start_panels = NULL;
+ static gboolean show_overview = FALSE;
++#endif
+ static gboolean verbose = FALSE;
+ static gboolean show_help = FALSE;
+ static gboolean show_help_gtk = FALSE;
+@@ -51,11 +53,15 @@ static gboolean show_help_all = FALSE;
+ const GOptionEntry all_options[] = {
+ { "version", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, option_version_cb, NULL, NULL },
+ { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, N_("Enable verbose mode"), NULL },
++#if 0
+ { "overview", 'o', 0, G_OPTION_ARG_NONE, &show_overview, N_("Show the overview"), NULL },
++#endif
+ { "help", 'h', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &show_help, N_("Show help options"), NULL },
+ { "help-all", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &show_help_all, N_("Show help options"), NULL },
+ { "help-gtk", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &show_help_gtk, N_("Show help options"), NULL },
++#if 0
+ { G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_FILENAME_ARRAY, &start_panels, N_("Panel to display"), NULL },
++#endif
+ { NULL } /* end the list */
+ };
+
+@@ -71,13 +77,17 @@ application_command_line_cb (GApplication *application,
+ GError *error = NULL;
+
+ verbose = FALSE;
++#if 0
+ show_overview = FALSE;
++#endif
+ show_help = FALSE;
++#if 0
+ start_panels = NULL;
++#endif
+
+ argv = g_application_command_line_get_arguments (command_line, &argc);
+
+- context = g_option_context_new (N_("- System Settings"));
++ context = g_option_context_new (N_("- Administrator Settings"));
+ g_option_context_add_main_entries (context, all_options, GETTEXT_PACKAGE);
+ g_option_context_set_translation_domain(context, GETTEXT_PACKAGE);
+ g_option_context_add_group (context, gtk_get_option_group (TRUE));
+@@ -115,6 +125,7 @@ application_command_line_cb (GApplication *application,
+
+ gnome_control_center_show (shell, GTK_APPLICATION (application));
+
++#if 0
+ if (show_overview)
+ {
+ gnome_control_center_set_overview_page (shell);
+@@ -138,17 +149,20 @@ application_command_line_cb (GApplication *application,
+ }
+ }
+ }
++#endif
+
+ gnome_control_center_present (shell);
+ gdk_notify_startup_complete ();
+
+ g_strfreev (argv);
++#if 0
+ if (start_panels != NULL)
+ {
+ g_strfreev (start_panels);
+ start_panels = NULL;
+ }
+ show_overview = FALSE;
++#endif
+
+ return retval;
+ }
+@@ -169,6 +183,8 @@ main (int argc, char **argv)
+ GtkApplication *application;
+ int status;
+
++ bindtextdomain (YAST_CC_PACKAGE, YASTLOCALEDIR);
++ bind_textdomain_codeset (YAST_CC_PACKAGE, "UTF-8");
+ bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
+@@ -178,13 +194,17 @@ main (int argc, char **argv)
+ gtk_init (&argc, &argv);
+ cc_shell_log_init ();
+
++ GtkIconTheme * theme;
++ theme = gtk_icon_theme_get_default();
++ gtk_icon_theme_prepend_search_path (theme, "/usr/share/YaST2/theme/current");
++
+ /* register a symbolic icon size for use in sidebar lists */
+ gtk_icon_size_register ("cc-sidebar-list", 24, 24);
+
+ shell = gnome_control_center_new ();
+
+ /* enforce single instance of this application */
+- application = gtk_application_new ("org.gnome.ControlCenter", G_APPLICATION_HANDLES_COMMAND_LINE);
++ application = gtk_application_new ("org.opensuse.yast-control-center-gnome", G_APPLICATION_HANDLES_COMMAND_LINE);
+ g_signal_connect (application, "startup",
+ G_CALLBACK (application_startup_cb), shell);
+ g_signal_connect (application, "command-line",
+diff --git a/shell/gnome-control-center.c b/shell/gnome-control-center.c
+index a771282..652300b 100644
+--- a/shell/gnome-control-center.c
++++ b/shell/gnome-control-center.c
+@@ -31,8 +31,8 @@
+ #define GMENU_I_KNOW_THIS_IS_UNSTABLE
+ #include <gmenu-tree.h>
+
+-#include "cc-panel.h"
+-#include "cc-shell.h"
++#include <libgnome-control-center/cc-panel.h>
++#include <libgnome-control-center/cc-shell.h>
+ #include "shell-search-renderer.h"
+ #include "cc-shell-category-view.h"
+ #include "cc-shell-model.h"
+@@ -91,6 +91,33 @@ activate_panel (GnomeControlCenter *shell,
+ const gchar *name,
+ const gchar *icon_name)
+ {
++ GDesktopAppInfo *appinfo;
++ GdkAppLaunchContext *context;
++ GdkScreen *screen;
++ GdkDisplay *display;
++ GError *error;
++
++ appinfo = g_desktop_app_info_new_from_filename (desktop_file);
++
++ screen = gtk_widget_get_screen (shell->priv->window);
++ display = gdk_screen_get_display (screen);
++ context = gdk_display_get_app_launch_context (display);
++ gdk_app_launch_context_set_screen (context, screen);
++ gdk_app_launch_context_set_timestamp (context, gtk_get_current_event_time ());
++
++ error = NULL;
++ g_app_info_launch_uris (G_APP_INFO (appinfo), NULL,
++ (GAppLaunchContext *) context,
++ &error);
++
++ if (error) {
++ g_printerr ("Could not launch '%s': %s\n", id, error->message);
++ g_clear_error (&error);
++ }
++
++ g_object_unref (context);
++ g_object_unref (appinfo);
++#if 0
+ GnomeControlCenterPrivate *priv = shell->priv;
+ GType panel_type = G_TYPE_INVALID;
+ GList *panels, *l;
+@@ -170,6 +197,7 @@ activate_panel (GnomeControlCenter *shell,
+ g_warning ("Could not find the loadable module for panel '%s'", id);
+ }
+ }
++#endif
+ }
+
+ static void
+@@ -685,7 +713,7 @@ setup_model (GnomeControlCenter *shell)
+
+ priv->store = (GtkListStore *) cc_shell_model_new ();
+ priv->category_views = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+- priv->menu_tree = gmenu_tree_lookup (MENUDIR "/gnomecc.menu", 0);
++ priv->menu_tree = gmenu_tree_lookup ("YaST-gnome.menu", 0);
+
+ if (priv->menu_tree == NULL)
+ {
+@@ -701,6 +729,7 @@ setup_model (GnomeControlCenter *shell)
+ static void
+ load_panel_plugins (GnomeControlCenter *shell)
+ {
++#if 0
+ GList *modules;
+
+ /* only allow this function to be run once to prevent modules being loaded
+@@ -719,6 +748,7 @@ load_panel_plugins (GnomeControlCenter *shell)
+ modules = g_io_modules_load_all_in_directory (PANELS_DIR);
+ g_list_free (modules);
+
++#endif
+ }
+
+
+@@ -978,7 +1008,16 @@ on_window_size_allocate (GtkWidget *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);
++ 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
+diff --git a/shell/shell.ui b/shell/shell.ui
+index e63f19f..f8e0d7e 100644
+--- a/shell/shell.ui
++++ b/shell/shell.ui
+@@ -3,9 +3,9 @@
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-naming-policy project-wide -->
+ <object class="GtkWindow" id="main-window">
+- <property name="title" translatable="yes">System Settings</property>
+- <property name="resizable">False</property>
+- <property name="icon_name">preferences-desktop</property>
++ <property name="title" translatable="yes">Administrator Settings</property>
++ <property name="resizable">True</property>
++ <property name="icon_name">yast</property>
+ <property name="window_position">center</property>
+ <child>
+ <object class="GtkVBox" id="vbox1">
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 Mon Jul 25 12:21:36 2011
@@ -1,11 +1,44 @@
INCLUDES = $(CONTROL_CFLAGS)
AM_CPPFLAGS = \
- -DYASTLOCALEDIR="\"$(datadir)/YaST2/locale\"" \
+ -DGETTEXT_PACKAGE="\"gnome-control-center-2.0\"" \
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
- -DENABLE_NLS=1
+ -DYAST_CC_PACKAGE="\"control-center\"" \
+ -DYASTLOCALEDIR="\"$(datadir)/YaST2/locale\"" \
+ -DUIDIR="\"$(uidir)\""
ybin_PROGRAMS = y2controlcenter-gnome
-y2controlcenter_gnome_SOURCES = control-center.c
+MARSHAL_FILES = cc-shell-marshal.c cc-shell-marshal.h
+BUILT_SOURCES = $(MARSHAL_FILES)
+
+cc-shell-marshal.h: cc-shell-marshal.list
+ $(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=cc_shell_marshal $< --header > $@
+
+cc-shell-marshal.c: cc-shell-marshal.list
+ $(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=cc_shell_marshal $< --body --header > $@
+
+y2controlcenter_gnome_SOURCES = \
+ control-center.c \
+ cc-shell-log.c \
+ cc-shell-log.h \
+ gnome-control-center.c \
+ gnome-control-center.h \
+ shell-search-renderer.c \
+ shell-search-renderer.h \
+ cc-shell-category-view.c \
+ cc-shell-category-view.h \
+ cc-shell-item-view.c \
+ cc-shell-item-view.h \
+ cc-shell-model.c \
+ cc-shell-model.h \
+ $(MARSHAL_FILES)
+
y2controlcenter_gnome_LDADD = $(CONTROL_LIBS)
+
+uidir = $(pkgdatadir)/ui
+ui_DATA = shell.ui
+
+EXTRA_DIST = \
+ $(ui_DATA) \
+ cc-shell-marshal.list
Added: trunk/control-center-gnome/src/cc-shell-category-view.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cc-shel…
==============================================================================
--- trunk/control-center-gnome/src/cc-shell-category-view.c (added)
+++ trunk/control-center-gnome/src/cc-shell-category-view.c Mon Jul 25 12:21:36 2011
@@ -0,0 +1,261 @@
+/*
+ * 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>
+ */
+
+#include "cc-shell-category-view.h"
+#include "cc-shell-item-view.h"
+#include <libgnome-control-center/cc-shell.h>
+#include "cc-shell-model.h"
+
+G_DEFINE_TYPE (CcShellCategoryView, cc_shell_category_view, GTK_TYPE_FRAME)
+
+#define SHELL_CATEGORY_VIEW_PRIVATE(o) \
+ (G_TYPE_INSTANCE_GET_PRIVATE ((o), CC_TYPE_SHELL_CATEGORY_VIEW, CcShellCategoryViewPrivate))
+
+enum
+{
+ PROP_NAME = 1,
+ PROP_MODEL
+};
+
+struct _CcShellCategoryViewPrivate
+{
+ gchar *name;
+ GtkTreeModel *model;
+ GtkWidget *iconview;
+};
+
+static void
+cc_shell_category_view_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ CcShellCategoryViewPrivate *priv = CC_SHELL_CATEGORY_VIEW (object)->priv;
+
+ switch (property_id)
+ {
+ case PROP_NAME:
+ g_value_set_string (value, priv->name);
+ break;
+
+ case PROP_MODEL:
+ g_value_set_object (value, priv->model);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ }
+}
+
+static void
+cc_shell_category_view_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ CcShellCategoryViewPrivate *priv = CC_SHELL_CATEGORY_VIEW (object)->priv;
+
+ switch (property_id)
+ {
+ case PROP_NAME:
+ priv->name = g_value_dup_string (value);
+ break;
+
+ case PROP_MODEL:
+ priv->model = g_value_dup_object (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ }
+}
+
+static void
+cc_shell_category_view_dispose (GObject *object)
+{
+ CcShellCategoryViewPrivate *priv = CC_SHELL_CATEGORY_VIEW (object)->priv;
+
+ if (priv->model)
+ {
+ g_object_unref (priv->model);
+ priv->model = NULL;
+ }
+
+ G_OBJECT_CLASS (cc_shell_category_view_parent_class)->dispose (object);
+}
+
+static void
+cc_shell_category_view_finalize (GObject *object)
+{
+ CcShellCategoryViewPrivate *priv = CC_SHELL_CATEGORY_VIEW (object)->priv;
+
+ if (priv->name)
+ {
+ g_free (priv->name);
+ priv->name = NULL;
+ }
+
+ G_OBJECT_CLASS (cc_shell_category_view_parent_class)->finalize (object);
+}
+
+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;
+
+ 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);
+ 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));
+
+ /* create the header if required */
+ if (priv->name)
+ {
+ GtkWidget *label;
+ PangoAttrList *attrs;
+
+ label = gtk_label_new (priv->name);
+ attrs = pango_attr_list_new ();
+ pango_attr_list_insert (attrs, pango_attr_weight_new (PANGO_WEIGHT_BOLD));
+ 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);
+ }
+
+ /* add the iconview to the vbox */
+ gtk_box_pack_start (GTK_BOX (vbox), iconview, FALSE, TRUE, 0);
+
+ /* add the main vbox to the view */
+ gtk_container_add (GTK_CONTAINER (object), vbox);
+ gtk_widget_show_all (vbox);
+
+ 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));
+
+ object_class->get_property = cc_shell_category_view_get_property;
+ object_class->set_property = cc_shell_category_view_set_property;
+ object_class->dispose = cc_shell_category_view_dispose;
+ 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",
+ NULL,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY
+ | G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (object_class, PROP_NAME, pspec);
+
+ pspec = g_param_spec_object ("model",
+ "Model",
+ "Model of the category",
+ GTK_TYPE_TREE_MODEL,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY
+ | G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (object_class, PROP_MODEL, pspec);
+
+}
+
+static void
+cc_shell_category_view_init (CcShellCategoryView *self)
+{
+ self->priv = SHELL_CATEGORY_VIEW_PRIVATE (self);
+
+ gtk_frame_set_shadow_type (GTK_FRAME (self), GTK_SHADOW_NONE);
+}
+
+GtkWidget *
+cc_shell_category_view_new (const gchar *name,
+ GtkTreeModel *model)
+{
+ return g_object_new (CC_TYPE_SHELL_CATEGORY_VIEW,
+ "name", name,
+ "model", model, NULL);
+}
+
+CcShellItemView*
+cc_shell_category_view_get_item_view (CcShellCategoryView *self)
+{
+ return (CcShellItemView*) self->priv->iconview;
+}
Added: trunk/control-center-gnome/src/cc-shell-category-view.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cc-shel…
==============================================================================
--- trunk/control-center-gnome/src/cc-shell-category-view.h (added)
+++ trunk/control-center-gnome/src/cc-shell-category-view.h Mon Jul 25 12:21:36 2011
@@ -0,0 +1,76 @@
+/*
+ * 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_CATEGORY_VIEW_H
+#define _CC_SHELL_CATEGORY_VIEW_H
+
+#include <gtk/gtk.h>
+#include "cc-shell-item-view.h"
+
+G_BEGIN_DECLS
+
+#define CC_TYPE_SHELL_CATEGORY_VIEW cc_shell_category_view_get_type()
+
+#define CC_SHELL_CATEGORY_VIEW(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ CC_TYPE_SHELL_CATEGORY_VIEW, CcShellCategoryView))
+
+#define CC_SHELL_CATEGORY_VIEW_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), \
+ CC_TYPE_SHELL_CATEGORY_VIEW, CcShellCategoryViewClass))
+
+#define CC_IS_SHELL_CATEGORY_VIEW(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+ CC_TYPE_SHELL_CATEGORY_VIEW))
+
+#define CC_IS_SHELL_CATEGORY_VIEW_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+ CC_TYPE_SHELL_CATEGORY_VIEW))
+
+#define CC_SHELL_CATEGORY_VIEW_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+ CC_TYPE_SHELL_CATEGORY_VIEW, CcShellCategoryViewClass))
+
+typedef struct _CcShellCategoryView CcShellCategoryView;
+typedef struct _CcShellCategoryViewClass CcShellCategoryViewClass;
+typedef struct _CcShellCategoryViewPrivate CcShellCategoryViewPrivate;
+
+struct _CcShellCategoryView
+{
+ GtkFrame parent;
+
+ CcShellCategoryViewPrivate *priv;
+};
+
+struct _CcShellCategoryViewClass
+{
+ GtkFrameClass parent_class;
+};
+
+GType cc_shell_category_view_get_type (void) G_GNUC_CONST;
+
+GtkWidget *cc_shell_category_view_new (const gchar *name,
+ GtkTreeModel *model);
+CcShellItemView* cc_shell_category_view_get_item_view (CcShellCategoryView *self);
+
+G_END_DECLS
+
+#endif /* _CC_SHELL_CATEGORY_VIEW_H */
Added: trunk/control-center-gnome/src/cc-shell-item-view.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cc-shel…
==============================================================================
--- trunk/control-center-gnome/src/cc-shell-item-view.c (added)
+++ trunk/control-center-gnome/src/cc-shell-item-view.c Mon Jul 25 12:21:36 2011
@@ -0,0 +1,215 @@
+/*
+ * 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>
+ */
+
+#include "cc-shell-item-view.h"
+#include "cc-shell-model.h"
+#include "cc-shell-marshal.h"
+
+G_DEFINE_TYPE (CcShellItemView, cc_shell_item_view, GTK_TYPE_ICON_VIEW)
+
+#define SHELL_ITEM_VIEW_PRIVATE(o) \
+ (G_TYPE_INSTANCE_GET_PRIVATE ((o), CC_TYPE_SHELL_ITEM_VIEW, CcShellItemViewPrivate))
+
+struct _CcShellItemViewPrivate
+{
+ gboolean ignore_release;
+};
+
+
+enum
+{
+ DESKTOP_ITEM_ACTIVATED,
+
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = {0,};
+
+static void
+cc_shell_item_view_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id)
+ {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ }
+}
+
+static void
+cc_shell_item_view_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id)
+ {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ }
+}
+
+static void
+cc_shell_item_view_dispose (GObject *object)
+{
+ G_OBJECT_CLASS (cc_shell_item_view_parent_class)->dispose (object);
+}
+
+static void
+cc_shell_item_view_finalize (GObject *object)
+{
+ G_OBJECT_CLASS (cc_shell_item_view_parent_class)->finalize (object);
+}
+
+static gboolean
+iconview_button_press_event_cb (GtkWidget *widget,
+ GdkEventButton *event,
+ CcShellItemView *cc_view)
+{
+ /* be sure to ignore double and triple clicks */
+ cc_view->priv->ignore_release = (event->type != GDK_BUTTON_PRESS);
+
+ return FALSE;
+}
+
+static gboolean
+iconview_button_release_event_cb (GtkWidget *widget,
+ GdkEventButton *event,
+ CcShellItemView *cc_view)
+{
+ CcShellItemViewPrivate *priv = cc_view->priv;
+
+ if (event->button == 1 && !priv->ignore_release)
+ {
+ GList *selection;
+
+ selection =
+ gtk_icon_view_get_selected_items (GTK_ICON_VIEW (cc_view));
+
+ if (!selection)
+ return TRUE;
+
+ gtk_icon_view_item_activated (GTK_ICON_VIEW (cc_view),
+ (GtkTreePath*) selection->data);
+
+ g_list_free (selection);
+ }
+
+ return TRUE;
+}
+
+static void
+iconview_item_activated_cb (GtkIconView *icon_view,
+ GtkTreePath *path,
+ CcShellItemView *cc_view)
+{
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ gchar *name, *desktop_file, *id;
+
+ model = gtk_icon_view_get_model (icon_view);
+
+ gtk_icon_view_unselect_all (icon_view);
+
+ /* get the iter and ensure it is valid */
+ if (!gtk_tree_model_get_iter (model, &iter, path))
+ return;
+
+ gtk_tree_model_get (model, &iter,
+ COL_NAME, &name,
+ COL_DESKTOP_FILE, &desktop_file,
+ COL_ID, &id,
+ -1);
+
+ g_signal_emit (cc_view, signals[DESKTOP_ITEM_ACTIVATED], 0,
+ name, id, desktop_file);
+
+ g_free (desktop_file);
+ g_free (name);
+ g_free (id);
+}
+
+void
+cc_shell_item_view_update_cells (CcShellItemView *view)
+{
+ GList *cells, *l;
+
+ cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (view));
+ for (l = cells ; l != NULL; l = l->next)
+ {
+ GtkCellRenderer *cell = l->data;
+
+ if (GTK_IS_CELL_RENDERER_TEXT (cell)) {
+ g_object_set (G_OBJECT (cell),
+ "wrap-mode", PANGO_WRAP_WORD,
+ NULL);
+ /* We only have one text cell */
+ break;
+ }
+ }
+}
+
+static void
+cc_shell_item_view_class_init (CcShellItemViewClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (CcShellItemViewPrivate));
+
+ object_class->get_property = cc_shell_item_view_get_property;
+ object_class->set_property = cc_shell_item_view_set_property;
+ object_class->dispose = cc_shell_item_view_dispose;
+ object_class->finalize = cc_shell_item_view_finalize;
+
+ signals[DESKTOP_ITEM_ACTIVATED] = g_signal_new ("desktop-item-activated",
+ CC_TYPE_SHELL_ITEM_VIEW,
+ G_SIGNAL_RUN_FIRST,
+ 0,
+ NULL,
+ NULL,
+ cc_shell_marshal_VOID__STRING_STRING_STRING,
+ G_TYPE_NONE,
+ 3,
+ G_TYPE_STRING,
+ G_TYPE_STRING,
+ G_TYPE_STRING);
+}
+
+static void
+cc_shell_item_view_init (CcShellItemView *self)
+{
+ self->priv = SHELL_ITEM_VIEW_PRIVATE (self);
+
+ g_object_set (self, "margin", 0, NULL);
+ g_signal_connect (self, "item-activated",
+ G_CALLBACK (iconview_item_activated_cb), self);
+ g_signal_connect (self, "button-press-event",
+ G_CALLBACK (iconview_button_press_event_cb), self);
+ g_signal_connect (self, "button-release-event",
+ G_CALLBACK (iconview_button_release_event_cb), self);
+}
+
+GtkWidget *
+cc_shell_item_view_new (void)
+{
+ return g_object_new (CC_TYPE_SHELL_ITEM_VIEW, NULL);
+}
Added: trunk/control-center-gnome/src/cc-shell-item-view.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cc-shel…
==============================================================================
--- trunk/control-center-gnome/src/cc-shell-item-view.h (added)
+++ trunk/control-center-gnome/src/cc-shell-item-view.h Mon Jul 25 12:21:36 2011
@@ -0,0 +1,74 @@
+/*
+ * 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_ITEM_VIEW_H
+#define _CC_SHELL_ITEM_VIEW_H
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define CC_TYPE_SHELL_ITEM_VIEW cc_shell_item_view_get_type()
+
+#define CC_SHELL_ITEM_VIEW(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ CC_TYPE_SHELL_ITEM_VIEW, CcShellItemView))
+
+#define CC_SHELL_ITEM_VIEW_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), \
+ CC_TYPE_SHELL_ITEM_VIEW, CcShellItemViewClass))
+
+#define CC_IS_SHELL_ITEM_VIEW(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+ CC_TYPE_SHELL_ITEM_VIEW))
+
+#define CC_IS_SHELL_ITEM_VIEW_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+ CC_TYPE_SHELL_ITEM_VIEW))
+
+#define CC_SHELL_ITEM_VIEW_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+ CC_TYPE_SHELL_ITEM_VIEW, CcShellItemViewClass))
+
+typedef struct _CcShellItemView CcShellItemView;
+typedef struct _CcShellItemViewClass CcShellItemViewClass;
+typedef struct _CcShellItemViewPrivate CcShellItemViewPrivate;
+
+struct _CcShellItemView
+{
+ GtkIconView parent;
+
+ CcShellItemViewPrivate *priv;
+};
+
+struct _CcShellItemViewClass
+{
+ GtkIconViewClass parent_class;
+};
+
+GType cc_shell_item_view_get_type (void) G_GNUC_CONST;
+
+GtkWidget *cc_shell_item_view_new (void);
+
+void cc_shell_item_view_update_cells (CcShellItemView *view);
+
+G_END_DECLS
+
+#endif /* _CC_SHELL_ITEM_VIEW_H */
Added: trunk/control-center-gnome/src/cc-shell-log.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cc-shel…
==============================================================================
--- trunk/control-center-gnome/src/cc-shell-log.c (added)
+++ trunk/control-center-gnome/src/cc-shell-log.c Mon Jul 25 12:21:36 2011
@@ -0,0 +1,63 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2009 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 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.
+ *
+ */
+
+
+#include "config.h"
+
+#include <glib.h>
+#include <glib/gstdio.h>
+
+#include "cc-shell-log.h"
+
+static int log_levels = G_LOG_LEVEL_CRITICAL |
+ G_LOG_LEVEL_ERROR |
+ G_LOG_LEVEL_WARNING |
+ G_LOG_LEVEL_MESSAGE |
+ G_LOG_LEVEL_INFO |
+ G_LOG_LEVEL_DEBUG;
+
+static void
+cc_shell_log_default_handler (const gchar *log_domain,
+ GLogLevelFlags log_level,
+ const gchar *message,
+ gpointer unused_data)
+{
+ if ((log_level & log_levels) == 0)
+ return;
+
+ g_log_default_handler (log_domain, log_level, message, unused_data);
+}
+
+void
+cc_shell_log_init (void)
+{
+ g_log_set_default_handler (cc_shell_log_default_handler, NULL);
+}
+
+void
+cc_shell_log_set_debug (gboolean debug)
+{
+ if (debug) {
+ log_levels |= (G_LOG_LEVEL_DEBUG | G_LOG_LEVEL_INFO);
+ g_debug ("Enabling debugging");
+ } else {
+ log_levels &= ~ (G_LOG_LEVEL_DEBUG | G_LOG_LEVEL_INFO);
+ }
+}
Added: trunk/control-center-gnome/src/cc-shell-log.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cc-shel…
==============================================================================
--- trunk/control-center-gnome/src/cc-shell-log.h (added)
+++ trunk/control-center-gnome/src/cc-shell-log.h Mon Jul 25 12:21:36 2011
@@ -0,0 +1,33 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2009 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 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.
+ *
+ */
+
+#ifndef __CC_SHELL_LOG_H
+#define __CC_SHELL_LOG_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+void cc_shell_log_init (void);
+void cc_shell_log_set_debug (gboolean debug);
+
+G_END_DECLS
+
+#endif /* __CC_SHELL_LOG_H */
Added: trunk/control-center-gnome/src/cc-shell-marshal.list
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cc-shel…
==============================================================================
--- trunk/control-center-gnome/src/cc-shell-marshal.list (added)
+++ trunk/control-center-gnome/src/cc-shell-marshal.list Mon Jul 25 12:21:36 2011
@@ -0,0 +1 @@
+VOID:STRING,STRING,STRING
Added: trunk/control-center-gnome/src/cc-shell-model.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cc-shel…
==============================================================================
--- trunk/control-center-gnome/src/cc-shell-model.c (added)
+++ trunk/control-center-gnome/src/cc-shell-model.c Mon Jul 25 12:21:36 2011
@@ -0,0 +1,223 @@
+/*
+ * Copyright (c) 2009, 2010 Intel, Inc.
+ * Copyright (c) 2010 Red Hat, 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>
+ */
+
+#include "cc-shell-model.h"
+#include <string.h>
+
+#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"
+
+
+G_DEFINE_TYPE (CcShellModel, cc_shell_model, GTK_TYPE_LIST_STORE)
+
+static GdkPixbuf *
+load_pixbuf_for_string (const char *icon)
+{
+ GtkIconTheme *theme;
+ GdkPixbuf *pixbuf;
+ GError *err = NULL;
+ char *icon2 = NULL;
+
+ if (icon == NULL)
+ return NULL;
+
+ theme = gtk_icon_theme_get_default ();
+
+ /* find the icon */
+ if (*icon == '/')
+ {
+ pixbuf = gdk_pixbuf_new_from_file_at_scale (icon, 32, 32, TRUE, &err);
+ }
+ else
+ {
+ if (g_str_has_suffix (icon, ".png"))
+ icon2 = g_strndup (icon, strlen (icon) - strlen (".png"));
+
+ pixbuf = gtk_icon_theme_load_icon (theme,
+ icon2 ? icon2 : icon, 32,
+ GTK_ICON_LOOKUP_FORCE_SIZE,
+ &err);
+ }
+
+ if (err)
+ {
+ g_warning ("Could not load icon '%s': %s", icon2 ? icon2 : icon,
+ err->message);
+ g_error_free (err);
+ }
+
+ g_free (icon2);
+
+ return pixbuf;
+}
+
+static void
+icon_theme_changed (GtkIconTheme *theme,
+ CcShellModel *self)
+{
+ GtkTreeIter iter;
+ GtkTreeModel *model;
+ gboolean cont;
+
+ model = GTK_TREE_MODEL (self);
+ cont = gtk_tree_model_get_iter_first (model, &iter);
+ while (cont)
+ {
+ GdkPixbuf *pixbuf;
+ char *icon;
+
+ gtk_tree_model_get (model, &iter,
+ COL_ICON_NAME, &icon,
+ -1);
+ pixbuf = load_pixbuf_for_string (icon);
+ g_free (icon);
+ gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+ COL_PIXBUF, pixbuf,
+ -1);
+
+ cont = gtk_tree_model_iter_next (model, &iter);
+ }
+}
+
+static void
+cc_shell_model_class_init (CcShellModelClass *klass)
+{
+}
+
+static void
+cc_shell_model_init (CcShellModel *self)
+{
+ GType types[] = {G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
+ GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRV};
+
+ gtk_list_store_set_column_types (GTK_LIST_STORE (self),
+ N_COLS, types);
+
+ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (self), COL_NAME,
+ GTK_SORT_ASCENDING);
+
+ g_signal_connect (G_OBJECT (gtk_icon_theme_get_default ()), "changed",
+ G_CALLBACK (icon_theme_changed), self);
+}
+
+CcShellModel *
+cc_shell_model_new (void)
+{
+ return g_object_new (CC_TYPE_SHELL_MODEL, NULL);
+}
+
+static gboolean
+desktop_entry_has_panel_category (GKeyFile *key_file)
+{
+ char **strv;
+ gsize len;
+ int i;
+
+ strv = g_key_file_get_string_list (key_file,
+ "Desktop Entry",
+ "Categories",
+ &len,
+ NULL);
+ if (!strv)
+ return FALSE;
+
+ for (i = 0; strv[i]; i++)
+ {
+ if (g_str_equal (strv[i], GNOME_SETTINGS_PANEL_CATEGORY))
+ {
+ g_strfreev (strv);
+ return TRUE;
+ }
+ }
+
+ g_strfreev (strv);
+
+ return FALSE;
+
+}
+
+void
+cc_shell_model_add_item (CcShellModel *model,
+ const gchar *category_name,
+ GMenuTreeEntry *item)
+{
+ const gchar *icon = gmenu_tree_entry_get_icon (item);
+ const gchar *name = gmenu_tree_entry_get_name (item);
+ const gchar *desktop = gmenu_tree_entry_get_desktop_file_path (item);
+ const gchar *comment = gmenu_tree_entry_get_comment (item);
+ gchar *id;
+ GdkPixbuf *pixbuf = NULL;
+ gchar *search_target;
+ GKeyFile *key_file;
+ gchar **keywords;
+
+ /* load the .desktop file since gnome-menus doesn't have a way to read
+ * custom properties from desktop files */
+
+ key_file = g_key_file_new ();
+ g_key_file_load_from_file (key_file, desktop, 0, NULL);
+
+ id = g_key_file_get_string (key_file, "Desktop Entry",
+ GNOME_SETTINGS_PANEL_ID_KEY, NULL);
+
+ if (!id)
+ {
+ /* Refuse to load desktop files without a panel ID, but
+ * with the X-GNOME-Settings-Panel category */
+ if (desktop_entry_has_panel_category (key_file))
+ {
+ g_warning ("Not loading desktop file '%s' because it uses the "
+ GNOME_SETTINGS_PANEL_CATEGORY
+ " category but isn't a panel.",
+ desktop);
+ g_key_file_free (key_file);
+ return;
+ }
+ id = g_strdup (gmenu_tree_entry_get_desktop_file_id (item));
+ }
+
+ keywords = g_key_file_get_locale_string_list (key_file, "Desktop Entry",
+ GNOME_SETTINGS_PANEL_ID_KEYWORDS,
+ NULL, NULL, NULL);
+
+ g_key_file_free (key_file);
+ key_file = NULL;
+
+ pixbuf = load_pixbuf_for_string (icon);
+
+ search_target = g_strconcat (name, " - ", comment, NULL);
+
+ gtk_list_store_insert_with_values (GTK_LIST_STORE (model), NULL, 0,
+ COL_NAME, name,
+ COL_DESKTOP_FILE, desktop,
+ COL_ID, id,
+ COL_PIXBUF, pixbuf,
+ COL_CATEGORY, category_name,
+ COL_SEARCH_TARGET, search_target,
+ COL_ICON_NAME, icon,
+ COL_KEYWORDS, keywords,
+ -1);
+
+ g_free (id);
+ g_free (search_target);
+ g_strfreev (keywords);
+}
Added: trunk/control-center-gnome/src/cc-shell-model.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/cc-shel…
==============================================================================
--- trunk/control-center-gnome/src/cc-shell-model.h (added)
+++ trunk/control-center-gnome/src/cc-shell-model.h Mon Jul 25 12:21:36 2011
@@ -0,0 +1,90 @@
+/*
+ * 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_MODEL_H
+#define _CC_SHELL_MODEL_H
+
+#include <gtk/gtk.h>
+#define GMENU_I_KNOW_THIS_IS_UNSTABLE
+#include <gmenu-tree.h>
+
+G_BEGIN_DECLS
+
+#define CC_TYPE_SHELL_MODEL cc_shell_model_get_type()
+
+#define CC_SHELL_MODEL(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ CC_TYPE_SHELL_MODEL, CcShellModel))
+
+#define CC_SHELL_MODEL_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), \
+ CC_TYPE_SHELL_MODEL, CcShellModelClass))
+
+#define CC_IS_SHELL_MODEL(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+ CC_TYPE_SHELL_MODEL))
+
+#define CC_IS_SHELL_MODEL_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+ CC_TYPE_SHELL_MODEL))
+
+#define CC_SHELL_MODEL_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+ CC_TYPE_SHELL_MODEL, CcShellModelClass))
+
+typedef struct _CcShellModel CcShellModel;
+typedef struct _CcShellModelClass CcShellModelClass;
+
+enum
+{
+ COL_NAME,
+ COL_DESKTOP_FILE,
+ COL_ID,
+ COL_PIXBUF,
+ COL_CATEGORY,
+ COL_SEARCH_TARGET,
+ COL_ICON_NAME,
+ COL_KEYWORDS,
+
+ N_COLS
+};
+
+struct _CcShellModel
+{
+ GtkListStore parent;
+};
+
+struct _CcShellModelClass
+{
+ GtkListStoreClass parent_class;
+};
+
+GType cc_shell_model_get_type (void) G_GNUC_CONST;
+
+CcShellModel *cc_shell_model_new (void);
+
+void cc_shell_model_add_item (CcShellModel *model,
+ const gchar *category_name,
+ GMenuTreeEntry *item);
+
+G_END_DECLS
+
+#endif /* _CC_SHELL_MODEL_H */
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 Mon Jul 25 12:21:36 2011
@@ -1,211 +1,218 @@
/*
- * This file is part of the Control Center.
+ * Copyright (c) 2009, 2010 Intel, Inc.
+ * Copyright (c) 2010 Red Hat, Inc.
*
- * Copyright (c) 2006 Novell, 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 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.
*
- * 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
*
- * 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>
*/
#include "config.h"
#include <glib/gi18n.h>
-#include <gtk/gtk.h>
-#include <libgnome/gnome-desktop-item.h>
-#include <unique/unique.h>
+#include <stdlib.h>
-#include <libslab/slab.h>
+#include "gnome-control-center.h"
-void handle_static_action_clicked (Tile * tile, TileEvent * event, gpointer data);
-static GSList *get_actions_list ();
+#include <gtk/gtk.h>
+#include <string.h>
-#define CONTROL_CENTER_PREFIX "/apps/yast-control-center/cc_"
-#define CONTROL_CENTER_ACTIONS_LIST_KEY (CONTROL_CENTER_PREFIX "actions_list")
-#define CONTROL_CENTER_ACTIONS_SEPARATOR ";"
-#define EXIT_SHELL_ON_STATIC_ACTION "exit_shell_on_static_action"
+#include "cc-shell-log.h"
-#define GETTEXT_PACKAGE "gnome-control-center-2.0"
-#define YAST_CC_PACKAGE "control-center"
+G_GNUC_NORETURN static gboolean
+option_version_cb (const gchar *option_name,
+ const gchar *value,
+ gpointer data,
+ GError **error)
+{
+ g_print ("%s %s\n", PACKAGE, VERSION);
+ exit (0);
+}
-static GSList *
-get_actions_list (void)
+#if 0
+static char **start_panels = NULL;
+static gboolean show_overview = FALSE;
+#endif
+static gboolean verbose = FALSE;
+static gboolean show_help = FALSE;
+static gboolean show_help_gtk = FALSE;
+static gboolean show_help_all = FALSE;
+
+const GOptionEntry all_options[] = {
+ { "version", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, option_version_cb, NULL, NULL },
+ { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, N_("Enable verbose mode"), NULL },
+#if 0
+ { "overview", 'o', 0, G_OPTION_ARG_NONE, &show_overview, N_("Show the overview"), NULL },
+#endif
+ { "help", 'h', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &show_help, N_("Show help options"), NULL },
+ { "help-all", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &show_help_all, N_("Show help options"), NULL },
+ { "help-gtk", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &show_help_gtk, N_("Show help options"), NULL },
+#if 0
+ { G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_FILENAME_ARRAY, &start_panels, N_("Panel to display"), NULL },
+#endif
+ { NULL } /* end the list */
+};
+
+static int
+application_command_line_cb (GApplication *application,
+ GApplicationCommandLine *command_line,
+ GnomeControlCenter *shell)
{
- GSList *l;
- GSList *key_list;
- GSList *actions_list = NULL;
- AppAction *action;
-
- key_list = get_slab_gconf_slist (CONTROL_CENTER_ACTIONS_LIST_KEY);
- if (!key_list)
- {
- g_warning (_("key not found [%s]\n"), CONTROL_CENTER_ACTIONS_LIST_KEY);
- return NULL;
- }
-
- for (l = key_list; l != NULL; l = l->next)
- {
- gchar *entry = (gchar *) l->data;
- gchar **temp;
-
- action = g_new (AppAction, 1);
- temp = g_strsplit (entry, CONTROL_CENTER_ACTIONS_SEPARATOR, 2);
- action->name = g_strdup (temp[0]);
- if ((action->item = load_desktop_item_from_unknown (temp[1])) == NULL)
- {
- g_warning ("get_actions_list() - PROBLEM - Can't load %s\n", temp[1]);
- }
- else
- {
- actions_list = g_slist_prepend (actions_list, action);
- }
- g_strfreev (temp);
- g_free (entry);
- }
+ int argc;
+ char **argv;
+ int retval = 0;
+ GOptionContext *context;
+ GError *error = NULL;
+
+ verbose = FALSE;
+#if 0
+ show_overview = FALSE;
+#endif
+ show_help = FALSE;
+#if 0
+ start_panels = NULL;
+#endif
+
+ argv = g_application_command_line_get_arguments (command_line, &argc);
+
+ context = g_option_context_new (N_("- Administrator Settings"));
+ g_option_context_add_main_entries (context, all_options, GETTEXT_PACKAGE);
+ g_option_context_set_translation_domain(context, GETTEXT_PACKAGE);
+ g_option_context_add_group (context, gtk_get_option_group (TRUE));
+ g_option_context_set_help_enabled (context, FALSE);
+
+ if (g_option_context_parse (context, &argc, &argv, &error) == FALSE)
+ {
+ g_print (_("%s\nRun '%s --help' to see a full list of available command line options.\n"),
+ error->message, argv[0]);
+ g_error_free (error);
+ g_option_context_free (context);
+ return 1;
+ }
+
+ if (show_help || show_help_all || show_help_gtk)
+ {
+ gchar *help;
+ GOptionGroup *group;
+
+ if (show_help || show_help_all)
+ group = NULL;
+ else
+ group = gtk_get_option_group (FALSE);
+
+ help = g_option_context_get_help (context, FALSE, group);
+ g_print ("%s", help);
+ g_free (help);
+ g_option_context_free (context);
+ return 0;
+ }
+
+ g_option_context_free (context);
+
+ cc_shell_log_set_debug (verbose);
+
+ gnome_control_center_show (shell, GTK_APPLICATION (application));
+
+#if 0
+ if (show_overview)
+ {
+ gnome_control_center_set_overview_page (shell);
+ }
+ else if (start_panels != NULL && start_panels[0] != NULL)
+ {
+ const char *start_id;
+ GError *err = NULL;
+
+ start_id = start_panels[0];
+
+ if (!cc_shell_set_active_panel_from_id (CC_SHELL (shell), start_id, &err))
+ {
+ g_warning ("Could not load setting panel \"%s\": %s", start_id,
+ (err) ? err->message : "Unknown error");
+ retval = 1;
+ if (err)
+ {
+ g_error_free (err);
+ err = NULL;
+ }
+ }
+ }
+#endif
+
+ gnome_control_center_present (shell);
+ gdk_notify_startup_complete ();
- g_slist_free (key_list);
+ g_strfreev (argv);
+#if 0
+ if (start_panels != NULL)
+ {
+ g_strfreev (start_panels);
+ start_panels = NULL;
+ }
+ show_overview = FALSE;
+#endif
- return g_slist_reverse (actions_list);
+ return retval;
}
-void
-handle_static_action_clicked (Tile * tile, TileEvent * event, gpointer data)
+static void
+application_startup_cb (GApplication *application,
+ GnomeControlCenter *shell)
{
- gchar *temp;
- AppShellData *app_data = (AppShellData *) data;
- GnomeDesktopItem *item =
- (GnomeDesktopItem *) g_object_get_data (G_OBJECT (tile), APP_ACTION_KEY);
-
- if (event->type == TILE_EVENT_ACTIVATED_DOUBLE_CLICK)
- return;
- open_desktop_item_exec (item);
-
- temp = g_strdup_printf("%s%s", app_data->gconf_prefix, EXIT_SHELL_ON_STATIC_ACTION);
- if (get_slab_gconf_bool(temp))
- {
- if (app_data->exit_on_close)
- gtk_main_quit ();
- else
- hide_shell (app_data);
- }
- g_free (temp);
+ /* nothing to do here, we don't want to show a window before
+ * we've looked at the commandline
+ */
}
-static UniqueResponse
-message_received_cb (UniqueApp *app,
- UniqueCommand command,
- UniqueMessageData *message,
- guint time,
- gpointer user_data)
+int
+main (int argc, char **argv)
{
- UniqueResponse res;
- AppShellData *app_data = user_data;
+ GnomeControlCenter *shell;
+ GtkApplication *application;
+ int status;
- switch (command) {
- case UNIQUE_ACTIVATE:
- /* move the main window to the screen that sent us the command */
- gtk_window_set_screen (GTK_WINDOW (app_data->main_app),
- unique_message_data_get_screen (message));
- if (!app_data->main_app_window_shown_once)
- show_shell (app_data);
-
- gtk_window_present_with_time (GTK_WINDOW (app_data->main_app),
- time);
-
- gtk_widget_grab_focus (SLAB_SECTION (app_data->filter_section)->contents);
-
- res = UNIQUE_RESPONSE_OK;
- break;
- default:
- res = UNIQUE_RESPONSE_PASSTHROUGH;
- break;
- }
+ bindtextdomain (YAST_CC_PACKAGE, YASTLOCALEDIR);
+ bind_textdomain_codeset (YAST_CC_PACKAGE, "UTF-8");
+ bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
- return res;
-}
-int
-main (int argc, char *argv[])
-{
- gboolean hidden = FALSE;
- UniqueApp *unique_app;
- AppShellData *app_data;
- GSList *actions;
- GError *error;
- GOptionEntry options[] = {
- { "hide", 0, 0, G_OPTION_ARG_NONE, &hidden, N_("Hide on start (useful to preload the shell)"), NULL },
- { NULL }
- };
-
-#ifdef ENABLE_NLS
- bindtextdomain (YAST_CC_PACKAGE, YASTLOCALEDIR);
- bind_textdomain_codeset (YAST_CC_PACKAGE, "UTF-8");
- bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-#endif
-
- error = NULL;
- if (!gtk_init_with_args (&argc, &argv,
- NULL, options, GETTEXT_PACKAGE, &error)) {
- g_printerr ("%s\n", error->message);
- g_error_free (error);
- return 1;
- }
-
- /* we don't want to use dbus as a backend for unique, since we're
- * running as root */
- g_setenv ("UNIQUE_BACKEND", "bacon", TRUE);
- unique_app = unique_app_new ("org.opensuse.yast-control-center-gnome", NULL);
- if (unique_app_is_running (unique_app)) {
- int retval = 0;
-
- if (!hidden) {
- UniqueResponse response;
- response = unique_app_send_message (unique_app,
- UNIQUE_ACTIVATE,
- NULL);
- retval = (response != UNIQUE_RESPONSE_OK);
- }
-
- g_object_unref (unique_app);
- return retval;
- }
-
- GtkIconTheme * theme;
- theme = gtk_icon_theme_get_default();
- gtk_icon_theme_prepend_search_path (theme, "/usr/share/YaST2/theme/current");
-
- app_data = appshelldata_new ("YaST-gnome.menu", NULL, CONTROL_CENTER_PREFIX,
- GTK_ICON_SIZE_DND, FALSE, TRUE);
- generate_categories (app_data);
-
- actions = get_actions_list ();
- layout_shell (app_data, _("Filter"), _("Groups"), _("Common Tasks"), actions,
- handle_static_action_clicked);
-
- textdomain (YAST_CC_PACKAGE);
- create_main_window (app_data, "y2ccg-control-center", _("YaST2 Control Center"),
- "yast", 975, 600, hidden);
- textdomain (GETTEXT_PACKAGE);
-
- unique_app_watch_window (unique_app, GTK_WINDOW (app_data->main_app));
- g_signal_connect (unique_app, "message-received",
- G_CALLBACK (message_received_cb), app_data);
+ g_thread_init (NULL);
+ gtk_init (&argc, &argv);
+ cc_shell_log_init ();
- gtk_main ();
+ GtkIconTheme * theme;
+ theme = gtk_icon_theme_get_default();
+ gtk_icon_theme_prepend_search_path (theme, "/usr/share/YaST2/theme/current");
- g_object_unref (unique_app);
+ /* register a symbolic icon size for use in sidebar lists */
+ gtk_icon_size_register ("cc-sidebar-list", 24, 24);
- return 0;
-};
+ shell = gnome_control_center_new ();
+
+ /* enforce single instance of this application */
+ application = gtk_application_new ("org.opensuse.yast-control-center-gnome", G_APPLICATION_HANDLES_COMMAND_LINE);
+ g_signal_connect (application, "startup",
+ G_CALLBACK (application_startup_cb), shell);
+ g_signal_connect (application, "command-line",
+ G_CALLBACK (application_command_line_cb), shell);
+
+ status = g_application_run (G_APPLICATION (application), argc, argv);
+
+ g_object_unref (application);
+
+ return status;
+}
Added: 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 (added)
+++ trunk/control-center-gnome/src/gnome-control-center.c Mon Jul 25 12:21:36 2011
@@ -0,0 +1,1163 @@
+/*
+ * Copyright (c) 2009, 2010 Intel, Inc.
+ * Copyright (c) 2010 Red Hat, 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>
+ */
+
+
+#include "gnome-control-center.h"
+
+#include <glib/gi18n.h>
+#include <gio/gio.h>
+#include <gio/gdesktopappinfo.h>
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+#include <string.h>
+#define GMENU_I_KNOW_THIS_IS_UNSTABLE
+#include <gmenu-tree.h>
+
+#include <libgnome-control-center/cc-panel.h>
+#include <libgnome-control-center/cc-shell.h>
+#include "shell-search-renderer.h"
+#include "cc-shell-category-view.h"
+#include "cc-shell-model.h"
+
+G_DEFINE_TYPE (GnomeControlCenter, gnome_control_center, CC_TYPE_SHELL)
+
+#define CONTROL_CENTER_PRIVATE(o) \
+ (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNOME_TYPE_CONTROL_CENTER, GnomeControlCenterPrivate))
+
+#define W(b,x) GTK_WIDGET (gtk_builder_get_object (b, x))
+
+enum
+{
+ OVERVIEW_PAGE,
+ SEARCH_PAGE,
+ CAPPLET_PAGE
+};
+
+
+struct _GnomeControlCenterPrivate
+{
+ GtkBuilder *builder;
+ GtkWidget *notebook;
+ GtkWidget *main_vbox;
+ GtkWidget *scrolled_window;
+ GtkWidget *window;
+ GtkWidget *search_entry;
+ GtkWidget *lock_button;
+
+ GMenuTree *menu_tree;
+ GtkListStore *store;
+ GHashTable *category_views;
+
+ GtkTreeModel *search_filter;
+ GtkWidget *search_view;
+ GtkCellRenderer *search_renderer;
+ gchar *filter_string;
+
+ guint32 last_time;
+
+ GIOExtensionPoint *extension_point;
+
+ gchar *default_window_title;
+ 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 void
+activate_panel (GnomeControlCenter *shell,
+ const gchar *id,
+ const gchar *desktop_file,
+ const gchar *name,
+ const gchar *icon_name)
+{
+ GDesktopAppInfo *appinfo;
+ GdkAppLaunchContext *context;
+ GdkScreen *screen;
+ GdkDisplay *display;
+ GError *error;
+
+ appinfo = g_desktop_app_info_new_from_filename (desktop_file);
+
+ screen = gtk_widget_get_screen (shell->priv->window);
+ display = gdk_screen_get_display (screen);
+ context = gdk_display_get_app_launch_context (display);
+ gdk_app_launch_context_set_screen (context, screen);
+ gdk_app_launch_context_set_timestamp (context, gtk_get_current_event_time ());
+
+ error = NULL;
+ g_app_info_launch_uris (G_APP_INFO (appinfo), NULL,
+ (GAppLaunchContext *) context,
+ &error);
+
+ if (error) {
+ g_printerr ("Could not launch '%s': %s\n", id, error->message);
+ g_clear_error (&error);
+ }
+
+ g_object_unref (context);
+ g_object_unref (appinfo);
+#if 0
+ GnomeControlCenterPrivate *priv = shell->priv;
+ GType panel_type = G_TYPE_INVALID;
+ GList *panels, *l;
+
+ /* check if there is an plugin that implements this panel */
+ panels = g_io_extension_point_get_extensions (priv->extension_point);
+
+ if (!desktop_file)
+ return;
+
+ if (id)
+ {
+
+ for (l = panels; l != NULL; l = l->next)
+ {
+ GIOExtension *extension;
+ const gchar *name;
+
+ extension = l->data;
+
+ name = g_io_extension_get_name (extension);
+
+ if (!g_strcmp0 (name, id))
+ {
+ panel_type = g_io_extension_get_type (extension);
+ break;
+ }
+ }
+
+ if (panel_type != G_TYPE_INVALID)
+ {
+ GtkWidget *panel;
+ GtkWidget *box;
+ gint i;
+ int nat_height;
+
+ /* create the panel plugin */
+ panel = g_object_new (panel_type, "shell", shell, NULL);
+
+ gtk_lock_button_set_permission (GTK_LOCK_BUTTON (priv->lock_button),
+ cc_panel_get_permission (CC_PANEL (panel)));
+
+ box = gtk_alignment_new (0, 0, 1, 1);
+ gtk_alignment_set_padding (GTK_ALIGNMENT (box), 6, 6, 6, 6);
+
+ gtk_container_add (GTK_CONTAINER (box), panel);
+
+ i = gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook), box,
+ NULL);
+
+ /* switch to the new panel */
+ gtk_widget_show (box);
+ gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), i);
+
+ /* set the title of the window */
+ gtk_window_set_title (GTK_WINDOW (priv->window), name);
+ gtk_window_set_default_icon_name (icon_name);
+ gtk_window_set_icon_name (GTK_WINDOW (priv->window), icon_name);
+
+ gtk_widget_show (panel);
+
+ /* 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);
+
+ /* resize to the preferred size of the panel */
+ gtk_widget_set_size_request (priv->window, FIXED_WIDTH, -1);
+ gtk_widget_get_preferred_height (GTK_WIDGET (priv->window),
+ NULL, &nat_height);
+ gtk_window_resize (GTK_WINDOW (priv->window),
+ FIXED_WIDTH,
+ nat_height);
+ return;
+ }
+ else
+ {
+ g_warning ("Could not find the loadable module for panel '%s'", id);
+ }
+ }
+#endif
+}
+
+static void
+shell_show_overview_page (GnomeControlCenterPrivate *priv)
+{
+ gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), OVERVIEW_PAGE);
+
+ gtk_notebook_remove_page (GTK_NOTEBOOK (priv->notebook), CAPPLET_PAGE);
+
+ /* clear the search text */
+ g_free (priv->filter_string);
+ priv->filter_string = g_strdup ("");
+ gtk_entry_set_text (GTK_ENTRY (priv->search_entry), "");
+
+ gtk_lock_button_set_permission (GTK_LOCK_BUTTON (priv->lock_button), NULL);
+
+ /* reset window title and icon */
+ gtk_window_set_title (GTK_WINDOW (priv->window), priv->default_window_title);
+ gtk_window_set_default_icon_name (priv->default_window_icon);
+ gtk_window_set_icon_name (GTK_WINDOW (priv->window),
+ priv->default_window_icon);
+}
+
+void
+gnome_control_center_set_overview_page (GnomeControlCenter *center)
+{
+ shell_show_overview_page (center->priv);
+}
+
+static void
+item_activated_cb (CcShellCategoryView *view,
+ gchar *name,
+ gchar *id,
+ gchar *desktop_file,
+ GnomeControlCenter *shell)
+{
+ GError *err = NULL;
+
+ if (!cc_shell_set_active_panel_from_id (CC_SHELL (shell), id, &err))
+ {
+ /* TODO: show message to user */
+ if (err)
+ {
+ g_warning ("Could not active panel \"%s\": %s", id, err->message);
+ g_error_free (err);
+ }
+ }
+}
+
+static gboolean
+category_focus_out (GtkWidget *view,
+ GdkEventFocus *event,
+ GnomeControlCenter *shell)
+{
+ gtk_icon_view_unselect_all (GTK_ICON_VIEW (view));
+
+ return FALSE;
+}
+
+static gboolean
+category_focus_in (GtkWidget *view,
+ GdkEventFocus *event,
+ GnomeControlCenter *shell)
+{
+ GtkTreePath *path;
+
+ if (!gtk_icon_view_get_cursor (GTK_ICON_VIEW (view), &path, NULL))
+ {
+ path = gtk_tree_path_new_from_indices (0, -1);
+ gtk_icon_view_set_cursor (GTK_ICON_VIEW (view), path, NULL, FALSE);
+ }
+
+ gtk_icon_view_select_path (GTK_ICON_VIEW (view), path);
+ gtk_tree_path_free (path);
+
+ return FALSE;
+}
+
+static GList *
+get_item_views (GnomeControlCenter *shell)
+{
+ GList *list, *l;
+ GList *res;
+
+ list = gtk_container_get_children (GTK_CONTAINER (shell->priv->main_vbox));
+ res = NULL;
+ for (l = list; l; l = l->next)
+ {
+ res = g_list_append (res, cc_shell_category_view_get_item_view (CC_SHELL_CATEGORY_VIEW (l->data)));
+ }
+
+ g_list_free (list);
+
+ return res;
+}
+
+static gboolean
+keynav_failed (GtkIconView *current_view,
+ GtkDirectionType direction,
+ GnomeControlCenter *shell)
+{
+ GList *views, *v;
+ GtkIconView *new_view;
+ GtkTreePath *path;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ gint col, c, dist, d;
+ GtkTreePath *sel;
+ gboolean res;
+
+ res = FALSE;
+
+ views = get_item_views (shell);
+
+ for (v = views; v; v = v->next)
+ {
+ if (v->data == current_view)
+ break;
+ }
+
+ if (direction == GTK_DIR_DOWN && v != NULL && v->next != NULL)
+ {
+ new_view = v->next->data;
+
+ if (gtk_icon_view_get_cursor (current_view, &path, NULL))
+ {
+ col = gtk_icon_view_get_item_column (current_view, path);
+ gtk_tree_path_free (path);
+
+ sel = NULL;
+ dist = 1000;
+ model = gtk_icon_view_get_model (new_view);
+ gtk_tree_model_get_iter_first (model, &iter);
+ do {
+ path = gtk_tree_model_get_path (model, &iter);
+ c = gtk_icon_view_get_item_column (new_view, path);
+ d = ABS (c - col);
+ if (d < dist)
+ {
+ if (sel)
+ gtk_tree_path_free (sel);
+ sel = path;
+ dist = d;
+ }
+ else
+ gtk_tree_path_free (path);
+ } while (gtk_tree_model_iter_next (model, &iter));
+
+ gtk_icon_view_set_cursor (new_view, sel, NULL, FALSE);
+ gtk_tree_path_free (sel);
+ }
+
+ gtk_widget_grab_focus (GTK_WIDGET (new_view));
+
+ res = TRUE;
+ }
+
+ if (direction == GTK_DIR_UP && v != NULL && v->prev != NULL)
+ {
+ new_view = v->prev->data;
+
+ if (gtk_icon_view_get_cursor (current_view, &path, NULL))
+ {
+ col = gtk_icon_view_get_item_column (current_view, path);
+ gtk_tree_path_free (path);
+
+ sel = NULL;
+ dist = 1000;
+ model = gtk_icon_view_get_model (new_view);
+ gtk_tree_model_get_iter_first (model, &iter);
+ do {
+ path = gtk_tree_model_get_path (model, &iter);
+ c = gtk_icon_view_get_item_column (new_view, path);
+ d = ABS (c - col);
+ if (d <= dist)
+ {
+ if (sel)
+ gtk_tree_path_free (sel);
+ sel = path;
+ dist = d;
+ }
+ else
+ gtk_tree_path_free (path);
+ } while (gtk_tree_model_iter_next (model, &iter));
+
+ gtk_icon_view_set_cursor (new_view, sel, NULL, FALSE);
+ gtk_tree_path_free (sel);
+ }
+
+ gtk_widget_grab_focus (GTK_WIDGET (new_view));
+
+ res = TRUE;
+ }
+
+ g_list_free (views);
+
+ return res;
+}
+
+static gboolean
+model_filter_func (GtkTreeModel *model,
+ GtkTreeIter *iter,
+ GnomeControlCenterPrivate *priv)
+{
+ gchar *name, *target;
+ gchar *needle, *haystack;
+ gboolean result;
+ gchar **keywords;
+
+ gtk_tree_model_get (model, iter, COL_NAME, &name,
+ COL_SEARCH_TARGET, &target,
+ COL_KEYWORDS, &keywords,
+ -1);
+
+ if (!priv->filter_string || !name || !target)
+ {
+ g_free (name);
+ g_free (target);
+ g_strfreev (keywords);
+ return FALSE;
+ }
+
+ needle = g_utf8_casefold (priv->filter_string, -1);
+ haystack = g_utf8_casefold (target, -1);
+
+ result = (strstr (haystack, needle) != NULL);
+
+ if (!result && keywords)
+ {
+ gint i;
+ gchar *keyword;
+
+ for (i = 0; !result && keywords[i]; i++)
+ {
+ keyword = g_utf8_casefold (keywords[i], -1);
+ result = strstr (keyword, needle) == keyword;
+ g_free (keyword);
+ }
+ }
+
+ g_free (name);
+ g_free (target);
+ g_free (haystack);
+ g_free (needle);
+ g_strfreev (keywords);
+
+ return result;
+}
+
+static gboolean
+category_filter_func (GtkTreeModel *model,
+ GtkTreeIter *iter,
+ gchar *filter)
+{
+ gchar *category;
+ gboolean result;
+
+ gtk_tree_model_get (model, iter, COL_CATEGORY, &category, -1);
+
+ result = (g_strcmp0 (category, filter) == 0);
+
+ g_free (category);
+
+ return result;
+}
+
+static void
+search_entry_changed_cb (GtkEntry *entry,
+ GnomeControlCenterPrivate *priv)
+{
+ char *str;
+
+ /* if the entry text was set manually (not by the user) */
+ if (!g_strcmp0 (priv->filter_string, gtk_entry_get_text (entry)))
+ return;
+
+ /* Don't re-filter for added trailing or leading spaces */
+ str = g_strdup (gtk_entry_get_text (entry));
+ g_strstrip (str);
+ if (!g_strcmp0 (str, priv->filter_string))
+ {
+ g_free (str);
+ return;
+ }
+
+ g_free (priv->filter_string);
+ priv->filter_string = str;
+
+ g_object_set (priv->search_renderer,
+ "search-string", priv->filter_string,
+ NULL);
+
+ if (!g_strcmp0 (priv->filter_string, ""))
+ {
+ shell_show_overview_page (priv);
+ g_object_set (G_OBJECT (entry),
+ "secondary-icon-name", "edit-find-symbolic",
+ "secondary-icon-activatable", FALSE,
+ "secondary-icon-sensitive", FALSE,
+ NULL);
+ }
+ else
+ {
+ gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (priv->search_filter));
+ gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook),
+ SEARCH_PAGE);
+ g_object_set (G_OBJECT (entry),
+ "secondary-icon-name", "edit-clear-symbolic",
+ "secondary-icon-activatable", TRUE,
+ "secondary-icon-sensitive", TRUE,
+ NULL);
+ }
+}
+
+static gboolean
+search_entry_key_press_event_cb (GtkEntry *entry,
+ GdkEventKey *event,
+ GnomeControlCenterPrivate *priv)
+{
+ if (event->keyval == GDK_KEY_Return)
+ {
+ GtkTreePath *path;
+
+ path = gtk_tree_path_new_first ();
+
+ priv->last_time = event->time;
+
+ gtk_icon_view_item_activated (GTK_ICON_VIEW (priv->search_view), path);
+
+ gtk_tree_path_free (path);
+ return TRUE;
+ }
+
+ if (event->keyval == GDK_KEY_Escape)
+ {
+ gtk_entry_set_text (entry, "");
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static void
+search_entry_clear_cb (GtkEntry *entry)
+{
+ gtk_entry_set_text (entry, "");
+}
+
+
+static void
+setup_search (GnomeControlCenter *shell)
+{
+ GtkWidget *search_scrolled, *search_view, *widget;
+ GnomeControlCenterPrivate *priv = shell->priv;
+
+ g_return_if_fail (priv->store != NULL);
+
+ /* create the search filter */
+ priv->search_filter = gtk_tree_model_filter_new (GTK_TREE_MODEL (priv->store),
+ NULL);
+
+ gtk_tree_model_filter_set_visible_func (GTK_TREE_MODEL_FILTER (priv->search_filter),
+ (GtkTreeModelFilterVisibleFunc)
+ model_filter_func,
+ priv, NULL);
+
+ /* set up the search view */
+ priv->search_view = search_view = cc_shell_item_view_new ();
+ gtk_icon_view_set_item_orientation (GTK_ICON_VIEW (search_view),
+ GTK_ORIENTATION_HORIZONTAL);
+ 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);
+
+ search_scrolled = W (priv->builder, "search-scrolled-window");
+ gtk_container_add (GTK_CONTAINER (search_scrolled), search_view);
+
+ /* add the custom renderer */
+ priv->search_renderer = (GtkCellRenderer*) shell_search_renderer_new ();
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (search_view),
+ priv->search_renderer, TRUE);
+ gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (search_view),
+ priv->search_renderer,
+ "title", COL_NAME);
+ gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (search_view),
+ priv->search_renderer,
+ "search-target", COL_SEARCH_TARGET);
+
+ /* connect the activated signal */
+ g_signal_connect (search_view, "desktop-item-activated",
+ G_CALLBACK (item_activated_cb), shell);
+
+ /* setup the search entry widget */
+ widget = (GtkWidget*) gtk_builder_get_object (priv->builder, "search-entry");
+ priv->search_entry = widget;
+ priv->filter_string = g_strdup ("");
+
+ g_signal_connect (widget, "changed", G_CALLBACK (search_entry_changed_cb),
+ priv);
+ g_signal_connect (widget, "key-press-event",
+ G_CALLBACK (search_entry_key_press_event_cb), priv);
+
+ g_signal_connect (widget, "icon-release", G_CALLBACK (search_entry_clear_cb),
+ priv);
+}
+
+static void
+setup_lock (GnomeControlCenter *shell)
+{
+ GnomeControlCenterPrivate *priv = shell->priv;
+
+ priv->lock_button = W (priv->builder, "lock-button");
+}
+
+static void
+maybe_add_category_view (GnomeControlCenter *shell,
+ const char *name)
+{
+ GtkTreeModel *filter;
+ GtkWidget *categoryview;
+
+ if (g_hash_table_lookup (shell->priv->category_views, name) != NULL)
+ return;
+
+ /* create new category view for this category */
+ filter = gtk_tree_model_filter_new (GTK_TREE_MODEL (shell->priv->store),
+ NULL);
+ gtk_tree_model_filter_set_visible_func (GTK_TREE_MODEL_FILTER (filter),
+ (GtkTreeModelFilterVisibleFunc) category_filter_func,
+ g_strdup (name), g_free);
+
+ categoryview = cc_shell_category_view_new (name, filter);
+ gtk_box_pack_start (GTK_BOX (shell->priv->main_vbox), categoryview, FALSE, TRUE, 0);
+
+ g_signal_connect (cc_shell_category_view_get_item_view (CC_SHELL_CATEGORY_VIEW (categoryview)),
+ "desktop-item-activated",
+ G_CALLBACK (item_activated_cb), shell);
+
+ gtk_widget_show (categoryview);
+
+ g_signal_connect (cc_shell_category_view_get_item_view (CC_SHELL_CATEGORY_VIEW (categoryview)),
+ "focus-in-event",
+ G_CALLBACK (category_focus_in), shell);
+ g_signal_connect (cc_shell_category_view_get_item_view (CC_SHELL_CATEGORY_VIEW (categoryview)),
+ "focus-out-event",
+ G_CALLBACK (category_focus_out), shell);
+ g_signal_connect (cc_shell_category_view_get_item_view (CC_SHELL_CATEGORY_VIEW (categoryview)),
+ "keynav-failed",
+ G_CALLBACK (keynav_failed), shell);
+
+ g_hash_table_insert (shell->priv->category_views, g_strdup (name), categoryview);
+}
+
+static void
+reload_menu (GnomeControlCenter *shell)
+{
+ GSList *list, *l;
+ GMenuTreeDirectory *d;
+
+ d = gmenu_tree_get_root_directory (shell->priv->menu_tree);
+ list = gmenu_tree_directory_get_contents (d);
+
+ for (l = list; l; l = l->next)
+ {
+ GMenuTreeItemType type;
+ type = gmenu_tree_item_get_type (l->data);
+
+ if (type == GMENU_TREE_ITEM_DIRECTORY)
+ {
+ GSList *contents, *f;
+ const gchar *dir_name;
+
+ contents = gmenu_tree_directory_get_contents (l->data);
+ dir_name = gmenu_tree_directory_get_name (l->data);
+
+ maybe_add_category_view (shell, dir_name);
+
+ /* add the items from this category to the model */
+ for (f = contents; f; f = f->next)
+ {
+ if (gmenu_tree_item_get_type (f->data) == GMENU_TREE_ITEM_ENTRY)
+ {
+ cc_shell_model_add_item (CC_SHELL_MODEL (shell->priv->store),
+ dir_name,
+ f->data);
+ }
+ }
+
+ g_slist_free (contents);
+ }
+ }
+
+ g_slist_free (list);
+}
+
+static void
+on_menu_changed (GMenuTree *monitor,
+ GnomeControlCenter *shell)
+{
+ gtk_list_store_clear (shell->priv->store);
+ reload_menu (shell);
+}
+
+static void
+setup_model (GnomeControlCenter *shell)
+{
+ GnomeControlCenterPrivate *priv = shell->priv;
+
+ gtk_container_set_border_width (GTK_CONTAINER (shell->priv->main_vbox), 10);
+ gtk_container_set_focus_vadjustment (GTK_CONTAINER (shell->priv->main_vbox),
+ gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (shell->priv->scrolled_window)));
+
+ priv->store = (GtkListStore *) cc_shell_model_new ();
+ priv->category_views = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+ priv->menu_tree = gmenu_tree_lookup ("YaST-gnome.menu", 0);
+
+ if (priv->menu_tree == NULL)
+ {
+ g_warning ("Could not find control center menu");
+ return;
+ }
+
+ reload_menu (shell);
+
+ gmenu_tree_add_monitor (priv->menu_tree, (GMenuTreeChangedFunc)on_menu_changed, shell);
+}
+
+static void
+load_panel_plugins (GnomeControlCenter *shell)
+{
+#if 0
+ GList *modules;
+
+ /* only allow this function to be run once to prevent modules being loaded
+ * twice
+ */
+ if (shell->priv->extension_point)
+ return;
+
+ /* make sure the base type is registered */
+ g_type_from_name ("CcPanel");
+
+ shell->priv->extension_point
+ = g_io_extension_point_register (CC_SHELL_PANEL_EXTENSION_POINT);
+
+ /* load all the plugins in the panels directory */
+ modules = g_io_modules_load_all_in_directory (PANELS_DIR);
+ g_list_free (modules);
+
+#endif
+}
+
+
+static void
+home_button_clicked_cb (GtkButton *button,
+ GnomeControlCenter *shell)
+{
+ shell_show_overview_page (shell->priv);
+}
+
+static void
+notebook_switch_page_cb (GtkNotebook *book,
+ GtkWidget *child,
+ gint page_num,
+ GnomeControlCenterPrivate *priv)
+{
+ /* make sure the home button is shown on all pages except the overview page */
+
+ if (page_num == OVERVIEW_PAGE || page_num == SEARCH_PAGE)
+ {
+ gtk_widget_hide (W (priv->builder, "home-button"));
+ gtk_widget_show (W (priv->builder, "search-entry"));
+ gtk_widget_hide (W (priv->builder, "lock-button"));
+ }
+ else
+ {
+ gtk_widget_show (W (priv->builder, "home-button"));
+ gtk_widget_hide (W (priv->builder, "search-entry"));
+ }
+}
+
+/* CcShell implementation */
+static gboolean
+_shell_set_active_panel_from_id (CcShell *shell,
+ const gchar *start_id,
+ GError **err)
+{
+ GtkTreeIter iter;
+ gboolean iter_valid;
+ gchar *name = NULL;
+ gchar *desktop, *icon_name;
+ GnomeControlCenterPrivate *priv = GNOME_CONTROL_CENTER (shell)->priv;
+
+
+ iter_valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->store),
+ &iter);
+
+ /* find the details for this item */
+ while (iter_valid)
+ {
+ gchar *id;
+
+ gtk_tree_model_get (GTK_TREE_MODEL (priv->store), &iter,
+ COL_NAME, &name,
+ COL_DESKTOP_FILE, &desktop,
+ COL_ICON_NAME, &icon_name,
+ COL_ID, &id,
+ -1);
+
+ if (id && !strcmp (id, start_id))
+ {
+ g_free (id);
+ break;
+ }
+ else
+ {
+ g_free (id);
+ g_free (name);
+ g_free (desktop);
+ g_free (icon_name);
+
+ name = NULL;
+ id = NULL;
+ }
+
+ iter_valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (priv->store),
+ &iter);
+ }
+
+ if (!name)
+ {
+ g_warning ("Could not find settings panel \"%s\"", start_id);
+ return FALSE;
+ }
+ else
+ {
+ gtk_notebook_remove_page (GTK_NOTEBOOK (priv->notebook), CAPPLET_PAGE);
+
+ activate_panel (GNOME_CONTROL_CENTER (shell), start_id, desktop, name,
+ icon_name);
+
+ g_free (name);
+ g_free (desktop);
+ g_free (icon_name);
+
+ return TRUE;
+ }
+}
+
+static GtkWidget *
+_shell_get_toplevel (CcShell *shell)
+{
+ return GNOME_CONTROL_CENTER (shell)->priv->window;
+}
+
+/* GObject Implementation */
+static void
+gnome_control_center_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id)
+ {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ }
+}
+
+static void
+gnome_control_center_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id)
+ {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ }
+}
+
+static void
+gnome_control_center_dispose (GObject *object)
+{
+ GnomeControlCenterPrivate *priv = GNOME_CONTROL_CENTER (object)->priv;
+
+ if (priv->window)
+ {
+ gtk_widget_destroy (priv->window);
+ priv->window = NULL;
+
+ /* destroying the window will destroy its children */
+ priv->notebook = NULL;
+ priv->search_entry = NULL;
+ priv->search_view = NULL;
+ priv->search_renderer = NULL;
+ }
+
+ if (priv->builder)
+ {
+ g_object_unref (priv->builder);
+ priv->builder = NULL;
+ }
+
+ if (priv->store)
+ {
+ g_object_unref (priv->store);
+ priv->store = NULL;
+ }
+
+ if (priv->search_filter)
+ {
+ g_object_unref (priv->search_filter);
+ priv->search_filter = NULL;
+ }
+
+
+ G_OBJECT_CLASS (gnome_control_center_parent_class)->dispose (object);
+}
+
+static void
+gnome_control_center_finalize (GObject *object)
+{
+ GnomeControlCenterPrivate *priv = GNOME_CONTROL_CENTER (object)->priv;
+
+ if (priv->filter_string)
+ {
+ g_free (priv->filter_string);
+ priv->filter_string = NULL;
+ }
+
+ if (priv->default_window_title)
+ {
+ g_free (priv->default_window_title);
+ priv->default_window_title = NULL;
+ }
+
+ if (priv->default_window_icon)
+ {
+ g_free (priv->default_window_icon);
+ priv->default_window_icon = NULL;
+ }
+
+ if (priv->menu_tree)
+ {
+ gmenu_tree_remove_monitor (priv->menu_tree, (GMenuTreeChangedFunc)on_menu_changed, object);
+ gmenu_tree_unref (priv->menu_tree);
+ }
+
+ if (priv->category_views)
+ {
+ g_hash_table_destroy (priv->category_views);
+ }
+
+ G_OBJECT_CLASS (gnome_control_center_parent_class)->finalize (object);
+}
+
+static void
+gnome_control_center_class_init (GnomeControlCenterClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ CcShellClass *shell_class = CC_SHELL_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (GnomeControlCenterPrivate));
+
+ object_class->get_property = gnome_control_center_get_property;
+ object_class->set_property = gnome_control_center_set_property;
+ object_class->dispose = gnome_control_center_dispose;
+ object_class->finalize = gnome_control_center_finalize;
+
+ shell_class->set_active_panel_from_id = _shell_set_active_panel_from_id;
+ 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)
+{
+ gboolean retval;
+
+ retval = FALSE;
+
+ if (!gtk_widget_get_visible (self->priv->search_entry))
+ return retval;
+
+ if (event->state != 0 &&
+ (event->state & GDK_CONTROL_MASK))
+ {
+ switch (event->keyval)
+ {
+ case GDK_KEY_s:
+ case GDK_KEY_S:
+ case GDK_KEY_f:
+ case GDK_KEY_F:
+ gtk_widget_grab_focus (self->priv->search_entry);
+ retval = TRUE;
+ break;
+ }
+ }
+ return retval;
+}
+
+static void
+gnome_control_center_init (GnomeControlCenter *self)
+{
+ GtkWidget *widget;
+ GError *err = NULL;
+ GnomeControlCenterPrivate *priv;
+
+ priv = self->priv = CONTROL_CENTER_PRIVATE (self);
+
+ /* load the user interface */
+ priv->builder = gtk_builder_new ();
+
+ if (!gtk_builder_add_from_file (priv->builder, UIDIR "/shell.ui", &err))
+ {
+ g_critical ("Could not build interface: %s", err->message);
+ g_error_free (err);
+
+ return;
+ }
+
+ /* connect various signals */
+ priv->window = W (priv->builder, "main-window");
+ g_signal_connect_swapped (priv->window, "delete-event", G_CALLBACK (g_object_unref), self);
+ g_signal_connect (priv->window, "key_press_event",
+ G_CALLBACK (window_key_press_event), self);
+
+ 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);
+
+ /* load the available settings panels */
+ setup_model (self);
+
+ /* load the panels that are implemented as plugins */
+ load_panel_plugins (self);
+
+ /* setup search functionality */
+ setup_search (self);
+
+ setup_lock (self);
+
+ /* 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)));
+}
+
+GnomeControlCenter *
+gnome_control_center_new (void)
+{
+ return g_object_new (GNOME_TYPE_CONTROL_CENTER, NULL);
+}
+
+void
+gnome_control_center_present (GnomeControlCenter *center)
+{
+ gtk_window_present (GTK_WINDOW (center->priv->window));
+}
+
+void
+gnome_control_center_show (GnomeControlCenter *center,
+ 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)));
+}
Added: trunk/control-center-gnome/src/gnome-control-center.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/gnome-c…
==============================================================================
--- trunk/control-center-gnome/src/gnome-control-center.h (added)
+++ trunk/control-center-gnome/src/gnome-control-center.h Mon Jul 25 12:21:36 2011
@@ -0,0 +1,79 @@
+/*
+ * 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 _GNOME_CONTROL_CENTER_H
+#define _GNOME_CONTROL_CENTER_H
+
+#include <glib-object.h>
+#include <libgnome-control-center/cc-shell.h>
+
+G_BEGIN_DECLS
+
+#define GNOME_TYPE_CONTROL_CENTER gnome_control_center_get_type()
+
+#define GNOME_CONTROL_CENTER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ GNOME_TYPE_CONTROL_CENTER, GnomeControlCenter))
+
+#define GNOME_CONTROL_CENTER_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), \
+ GNOME_TYPE_CONTROL_CENTER, GnomeControlCenterClass))
+
+#define GNOME_IS_CONTROL_CENTER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+ GNOME_TYPE_CONTROL_CENTER))
+
+#define GNOME_IS_CONTROL_CENTER_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+ GNOME_TYPE_CONTROL_CENTER))
+
+#define GNOME_CONTROL_CENTER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+ GNOME_TYPE_CONTROL_CENTER, GnomeControlCenterClass))
+
+typedef struct _GnomeControlCenter GnomeControlCenter;
+typedef struct _GnomeControlCenterClass GnomeControlCenterClass;
+typedef struct _GnomeControlCenterPrivate GnomeControlCenterPrivate;
+
+struct _GnomeControlCenter
+{
+ CcShell parent;
+
+ GnomeControlCenterPrivate *priv;
+};
+
+struct _GnomeControlCenterClass
+{
+ CcShellClass parent_class;
+};
+
+GType gnome_control_center_get_type (void) G_GNUC_CONST;
+
+GnomeControlCenter *gnome_control_center_new (void);
+
+void gnome_control_center_present (GnomeControlCenter *center);
+
+void gnome_control_center_show (GnomeControlCenter *center, GtkApplication *app);
+
+void gnome_control_center_set_overview_page (GnomeControlCenter *center);
+
+G_END_DECLS
+
+#endif /* _GNOME_CONTROL_CENTER_H */
Added: trunk/control-center-gnome/src/shell-search-renderer.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/shell-s…
==============================================================================
--- trunk/control-center-gnome/src/shell-search-renderer.c (added)
+++ trunk/control-center-gnome/src/shell-search-renderer.c Mon Jul 25 12:21:36 2011
@@ -0,0 +1,351 @@
+/*
+ * 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>
+ */
+
+#include "shell-search-renderer.h"
+#include <string.h>
+
+G_DEFINE_TYPE (ShellSearchRenderer, shell_search_renderer, GTK_TYPE_CELL_RENDERER_TEXT)
+
+#define SEARCH_RENDERER_PRIVATE(o) \
+ (G_TYPE_INSTANCE_GET_PRIVATE ((o), SHELL_TYPE_SEARCH_RENDERER, ShellSearchRendererPrivate))
+
+struct _ShellSearchRendererPrivate
+{
+ gchar *title;
+ gchar *search_target;
+ gchar *search_string;
+
+ PangoLayout *layout;
+};
+
+enum
+{
+ PROP_TITLE = 1,
+ PROP_SEARCH_TARGET,
+ PROP_SEARCH_STRING
+};
+
+
+static void
+shell_search_renderer_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id)
+ {
+ case PROP_TITLE:
+ case PROP_SEARCH_TARGET:
+ case PROP_SEARCH_STRING:
+ break;
+
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ }
+}
+
+static void
+shell_search_renderer_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ ShellSearchRendererPrivate *priv = SHELL_SEARCH_RENDERER (object)->priv;
+
+ switch (property_id)
+ {
+ case PROP_TITLE:
+ g_free (priv->title);
+ priv->title = g_value_dup_string (value);
+ /* set GtkCellRendererText::text for a11y */
+ g_object_set (object, "text", priv->title, NULL);
+ break;
+
+ case PROP_SEARCH_TARGET:
+ g_free (priv->search_target);
+ priv->search_target = g_value_dup_string (value);
+ break;
+
+ case PROP_SEARCH_STRING:
+ g_free (priv->search_string);
+ priv->search_string = g_value_dup_string (value);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ }
+}
+
+static void
+shell_search_renderer_dispose (GObject *object)
+{
+ ShellSearchRendererPrivate *priv = SHELL_SEARCH_RENDERER (object)->priv;
+
+ if (priv->layout)
+ {
+ g_object_unref (priv->layout);
+ priv->layout = NULL;
+ }
+
+ G_OBJECT_CLASS (shell_search_renderer_parent_class)->dispose (object);
+}
+
+static void
+shell_search_renderer_finalize (GObject *object)
+{
+ ShellSearchRendererPrivate *priv = SHELL_SEARCH_RENDERER (object)->priv;
+
+ if (priv->title)
+ {
+ g_free (priv->title);
+ priv->title = NULL;
+ }
+
+ if (priv->search_target)
+ {
+ g_free (priv->search_target);
+ priv->search_target = NULL;
+ }
+
+ if (priv->search_string)
+ {
+ g_free (priv->search_string);
+ priv->search_string = NULL;
+ }
+
+ G_OBJECT_CLASS (shell_search_renderer_parent_class)->finalize (object);
+}
+
+static void
+shell_search_renderer_set_layout (ShellSearchRenderer *cell, GtkWidget *widget)
+{
+ gchar *display_string;
+ ShellSearchRendererPrivate *priv = cell->priv;
+ gchar *needle, *haystack;
+ gchar *full_string;
+
+ if (!priv->layout)
+ {
+ priv->layout = pango_layout_new (gtk_widget_get_pango_context (widget));
+ pango_layout_set_ellipsize (priv->layout, PANGO_ELLIPSIZE_END);
+ }
+
+ full_string = priv->search_target;
+
+ if (priv->search_string != NULL)
+ needle = g_utf8_casefold (priv->search_string, -1);
+ else
+ needle = NULL;
+ haystack = g_utf8_casefold (full_string, -1);
+
+ /* clear any previous attributes */
+ pango_layout_set_attributes (priv->layout, NULL);
+
+ if (priv->search_string && priv->title
+ && (strstr (haystack, needle)))
+ {
+ gchar *start;
+ gchar *lead, *trail, *leaddot;
+ gchar *match;
+ gint count;
+
+#define CONTEXT 10
+
+ count = strlen (needle);
+ start = full_string + (strstr (haystack, needle) - haystack);
+
+ lead = MAX (start - CONTEXT, full_string);
+ trail = start + count;
+
+ if (lead == full_string)
+ leaddot = "";
+ else
+ leaddot = "â¦";
+
+ match = g_strndup (start, count);
+ lead = g_strndup (lead, start - lead);
+
+ display_string = g_markup_printf_escaped ("%s\n"
+ "<small>%s%s<b>%s</b>%s</small>",
+ priv->title, leaddot, lead,
+ match, trail);
+
+ g_free (match);
+ g_free (lead);
+ }
+ else
+ display_string = g_markup_escape_text (priv->title, -1);
+
+
+ pango_layout_set_markup (priv->layout, display_string, -1);
+ g_free (display_string);
+ g_free (needle);
+ g_free (haystack);
+}
+
+static void
+get_size (GtkCellRenderer *cell,
+ GtkWidget *widget,
+ gint *width,
+ gint *height)
+{
+ ShellSearchRendererPrivate *priv = SHELL_SEARCH_RENDERER (cell)->priv;
+ PangoRectangle rect;
+
+ shell_search_renderer_set_layout (SHELL_SEARCH_RENDERER (cell), widget);
+
+ pango_layout_set_width (priv->layout, PANGO_SCALE * 180);
+ pango_layout_get_pixel_extents (priv->layout, NULL, &rect);
+
+ if (width) *width = rect.width;
+ if (height) *height = rect.height;
+}
+
+static void
+shell_search_renderer_get_preferred_width (GtkCellRenderer *cell,
+ GtkWidget *widget,
+ gint *minimum_size,
+ gint *natural_size)
+{
+ gint width;
+
+ get_size (cell, widget, &width, NULL);
+ if (minimum_size) *minimum_size = width;
+ if (natural_size) *natural_size = width;
+}
+
+static void
+shell_search_renderer_get_preferred_height (GtkCellRenderer *cell,
+ GtkWidget *widget,
+ gint *minimum_size,
+ gint *natural_size)
+{
+ gint height;
+
+ get_size (cell, widget, NULL, &height);
+ if (minimum_size) *minimum_size = height;
+ if (natural_size) *natural_size = height;
+}
+
+static void
+shell_search_renderer_get_preferred_height_for_width (GtkCellRenderer *cell,
+ GtkWidget *widget,
+ gint width,
+ gint *minimum_height,
+ gint *natural_height)
+{
+ shell_search_renderer_get_preferred_height (cell, widget, minimum_height, natural_height);
+}
+
+static void
+shell_search_renderer_get_aligned_area (GtkCellRenderer *cell,
+ GtkWidget *widget,
+ GtkCellRendererState flags,
+ const GdkRectangle *cell_area,
+ GdkRectangle *aligned_area)
+{
+ get_size (cell, widget, &aligned_area->width, &aligned_area->height);
+ aligned_area->x = cell_area->x;
+ aligned_area->y = cell_area->y;
+}
+
+static void
+shell_search_renderer_render (GtkCellRenderer *cell,
+ cairo_t *cr,
+ GtkWidget *widget,
+ const GdkRectangle *background_area,
+ const GdkRectangle *cell_area,
+ GtkCellRendererState flags)
+{
+ ShellSearchRendererPrivate *priv = SHELL_SEARCH_RENDERER (cell)->priv;
+ PangoRectangle rect;
+ GtkStyleContext *context;
+
+ context = gtk_widget_get_style_context (widget);
+
+ shell_search_renderer_set_layout (SHELL_SEARCH_RENDERER (cell), widget);
+
+ pango_layout_get_pixel_extents (priv->layout, NULL, &rect);
+
+ cairo_save (cr);
+
+ gtk_render_layout (context, cr,
+ cell_area->x,
+ cell_area->y,
+ priv->layout);
+
+ cairo_restore (cr);
+}
+
+static void
+shell_search_renderer_class_init (ShellSearchRendererClass *klass)
+{
+ GParamSpec *pspec;
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkCellRendererClass *cell_renderer = GTK_CELL_RENDERER_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (ShellSearchRendererPrivate));
+
+ object_class->get_property = shell_search_renderer_get_property;
+ object_class->set_property = shell_search_renderer_set_property;
+ object_class->dispose = shell_search_renderer_dispose;
+ object_class->finalize = shell_search_renderer_finalize;
+
+ cell_renderer->get_preferred_width = shell_search_renderer_get_preferred_width;
+ cell_renderer->get_preferred_height = shell_search_renderer_get_preferred_height;
+ cell_renderer->get_preferred_height_for_width = shell_search_renderer_get_preferred_height_for_width;
+ cell_renderer->get_aligned_area = shell_search_renderer_get_aligned_area;
+
+ cell_renderer->render = shell_search_renderer_render;
+
+ pspec = g_param_spec_string ("title",
+ "Title",
+ "Item title",
+ "",
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (object_class, PROP_TITLE, pspec);
+
+ pspec = g_param_spec_string ("search-target",
+ "Search Target",
+ "The string that will be searched",
+ "",
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (object_class, PROP_SEARCH_TARGET, pspec);
+
+ pspec = g_param_spec_string ("search-string",
+ "Search String",
+ "Current search string",
+ "",
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (object_class, PROP_SEARCH_STRING, pspec);
+}
+
+static void
+shell_search_renderer_init (ShellSearchRenderer *self)
+{
+ self->priv = SEARCH_RENDERER_PRIVATE (self);
+}
+
+ShellSearchRenderer *
+shell_search_renderer_new (void)
+{
+ return g_object_new (SHELL_TYPE_SEARCH_RENDERER, NULL);
+}
Added: trunk/control-center-gnome/src/shell-search-renderer.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center-gnome/src/shell-s…
==============================================================================
--- trunk/control-center-gnome/src/shell-search-renderer.h (added)
+++ trunk/control-center-gnome/src/shell-search-renderer.h Mon Jul 25 12:21:36 2011
@@ -0,0 +1,74 @@
+/*
+ * 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 _SHELL_SEARCH_RENDERER_H
+#define _SHELL_SEARCH_RENDERER_H
+
+#include <glib-object.h>
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define SHELL_TYPE_SEARCH_RENDERER shell_search_renderer_get_type()
+
+#define SHELL_SEARCH_RENDERER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ SHELL_TYPE_SEARCH_RENDERER, ShellSearchRenderer))
+
+#define SHELL_SEARCH_RENDERER_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), \
+ SHELL_TYPE_SEARCH_RENDERER, ShellSearchRendererClass))
+
+#define SHELL_IS_SEARCH_RENDERER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+ SHELL_TYPE_SEARCH_RENDERER))
+
+#define SHELL_IS_SEARCH_RENDERER_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+ SHELL_TYPE_SEARCH_RENDERER))
+
+#define SHELL_SEARCH_RENDERER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+ SHELL_TYPE_SEARCH_RENDERER, ShellSearchRendererClass))
+
+typedef struct _ShellSearchRenderer ShellSearchRenderer;
+typedef struct _ShellSearchRendererClass ShellSearchRendererClass;
+typedef struct _ShellSearchRendererPrivate ShellSearchRendererPrivate;
+
+struct _ShellSearchRenderer
+{
+ GtkCellRendererText parent;
+
+ ShellSearchRendererPrivate *priv;
+};
+
+struct _ShellSearchRendererClass
+{
+ GtkCellRendererTextClass parent_class;
+};
+
+GType shell_search_renderer_get_type (void) G_GNUC_CONST;
+
+ShellSearchRenderer *shell_search_renderer_new (void);
+
+G_END_DECLS
+
+#endif /* _SHELL_SEARCH_RENDERER_H */
Added: 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 (added)
+++ trunk/control-center-gnome/src/shell.ui Mon Jul 25 12:21:36 2011
@@ -0,0 +1,173 @@
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-naming-policy project-wide -->
+ <object class="GtkWindow" id="main-window">
+ <property name="title" translatable="yes">Administrator Settings</property>
+ <property name="resizable">True</property>
+ <property name="icon_name">yast</property>
+ <property name="window_position">center</property>
+ <child>
+ <object class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkToolbar" id="toolbar1">
+ <property name="visible">True</property>
+ <style>
+ <class name="primary-toolbar"/>
+ </style>
+ <child>
+ <object class="GtkToolItem" id="toolbutton1">
+ <property name="visible">True</property>
+ <style>
+ <class name="raised"/>
+ </style>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="top_padding">5</property>
+ <property name="bottom_padding">5</property>
+ <property name="left_padding">10</property>
+ <property name="right_padding">5</property>
+ <child>
+ <object class="GtkHBox" id="hbox1">
+ <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>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="entry-alignment">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="xscale">0</property>
+ <child>
+ <object class="GtkBox" id="topright">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ <child>
+ <object class="GtkEntry" id="search-entry">
+ <property name="width_request">210</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="secondary-icon-name">edit-find-symbolic</property>
+ <property name="secondary-icon-activatable">False</property>
+ <property name="secondary-icon-sensitive">False</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLockButton" id="lock-button">
+ <property name="visible">False</property>
+ <property name="no_show_all">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkNotebook" id="notebook">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="show_tabs">False</property>
+ <property name="show_border">False</property>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <child>
+ <object class="GtkViewport" id="viewport">
+ <property name="visible">True</property>
+ <property name="resize_mode">queue</property>
+ <child>
+ <object class="GtkVBox" id="main-vbox">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="search-scrolled-window">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <object class="GtkListStore" id="liststore">
+ <columns>
+ <!-- column-name name -->
+ <column type="gchararray"/>
+ <!-- column-name exec -->
+ <column type="gchararray"/>
+ <!-- column-name icon -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
+ <object class="GtkSizeGroup" id="sizegroup">
+ <property name="mode">vertical</property>
+ <widgets>
+ <widget name="home-button"/>
+ <widget name="entry-alignment"/>
+ </widgets>
+ </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] r64978 - /tags/branch-Code-11-SP2-2_17_85/packager/
by lslezak@svn2.opensuse.org 25 Jul '11
by lslezak@svn2.opensuse.org 25 Jul '11
25 Jul '11
Author: lslezak
Date: Mon Jul 25 11:21:22 2011
New Revision: 64978
URL: http://svn.opensuse.org/viewcvs/yast?rev=64978&view=rev
Log:
Created tag branch-Code-11-SP2-2_17_85 for packager
Added:
tags/branch-Code-11-SP2-2_17_85/packager/ (props changed)
- copied from r64977, branches/SuSE-Code-11-SP2-Branch/packager/
--
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] r64977 - in /branches/SuSE-Code-11-SP2-Branch/autoinstallation: VERSION package/autoyast2.changes
by ug@svn2.opensuse.org 25 Jul '11
by ug@svn2.opensuse.org 25 Jul '11
25 Jul '11
Author: ug
Date: Mon Jul 25 11:19:03 2011
New Revision: 64977
URL: http://svn.opensuse.org/viewcvs/yast?rev=64977&view=rev
Log:
2.17.47
Modified:
branches/SuSE-Code-11-SP2-Branch/autoinstallation/VERSION
branches/SuSE-Code-11-SP2-Branch/autoinstallation/package/autoyast2.changes
Modified: branches/SuSE-Code-11-SP2-Branch/autoinstallation/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/autoi…
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/autoinstallation/VERSION (original)
+++ branches/SuSE-Code-11-SP2-Branch/autoinstallation/VERSION Mon Jul 25 11:19:03 2011
@@ -1 +1 @@
-2.17.46
+2.17.47
Modified: branches/SuSE-Code-11-SP2-Branch/autoinstallation/package/autoyast2.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/autoi…
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/autoinstallation/package/autoyast2.changes (original)
+++ branches/SuSE-Code-11-SP2-Branch/autoinstallation/package/autoyast2.changes Mon Jul 25 11:19:03 2011
@@ -3,6 +3,7 @@
- speed up partition calculation when a lot partitions are
reused (bnc#620212)
+- 2.17.47
-------------------------------------------------------------------
Mon Jul 25 10:06:25 CEST 2011 - ug(a)suse.de
--
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] r64976 - in /branches/SuSE-Code-11-SP2-Branch/packager: VERSION package/yast2-packager.changes src/clients/software_proposal.ycp src/modules/Packages.ycp
by lslezak@svn2.opensuse.org 25 Jul '11
by lslezak@svn2.opensuse.org 25 Jul '11
25 Jul '11
Author: lslezak
Date: Mon Jul 25 11:04:52 2011
New Revision: 64976
URL: http://svn.opensuse.org/viewcvs/yast?rev=64976&view=rev
Log:
- do not skip package proposal when the partitioner has changed
proposed packages - i.e. add snapper packages after switching to
btrfs (bnc#704127)
- 2.17.85
Modified:
branches/SuSE-Code-11-SP2-Branch/packager/VERSION
branches/SuSE-Code-11-SP2-Branch/packager/package/yast2-packager.changes
branches/SuSE-Code-11-SP2-Branch/packager/src/clients/software_proposal.ycp
branches/SuSE-Code-11-SP2-Branch/packager/src/modules/Packages.ycp
Modified: branches/SuSE-Code-11-SP2-Branch/packager/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/packa…
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/packager/VERSION (original)
+++ branches/SuSE-Code-11-SP2-Branch/packager/VERSION Mon Jul 25 11:04:52 2011
@@ -1 +1 @@
-2.17.84
+2.17.85
Modified: branches/SuSE-Code-11-SP2-Branch/packager/package/yast2-packager.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/packa…
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/packager/package/yast2-packager.changes (original)
+++ branches/SuSE-Code-11-SP2-Branch/packager/package/yast2-packager.changes Mon Jul 25 11:04:52 2011
@@ -1,4 +1,12 @@
-------------------------------------------------------------------
+Mon Jul 25 08:33:29 UTC 2011 - lslezak(a)suse.cz
+
+- do not skip package proposal when the partitioner has changed
+ proposed packages - i.e. add snapper packages after switching to
+ btrfs (bnc#704127)
+- 2.17.85
+
+-------------------------------------------------------------------
Mon Jun 27 15:45:13 UTC 2011 - lslezak(a)suse.cz
- remove the addon repository after aborting license confirmation
Modified: branches/SuSE-Code-11-SP2-Branch/packager/src/clients/software_proposal.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/packa…
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/packager/src/clients/software_proposal.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/packager/src/clients/software_proposal.ycp Mon Jul 25 11:04:52 2011
@@ -71,7 +71,7 @@
// if only partitioning has been changed just return the current state,
// don't reset to default (bnc#450786, bnc#371875)
- if (partition_changed && !language_changed && !force_reset)
+ if (partition_changed && !language_changed && !force_reset && !Packages::PackagesProposalChanged())
{
return Packages::Summary ([ `product, `pattern, `selection, `size, `desktop ], false);
}
Modified: branches/SuSE-Code-11-SP2-Branch/packager/src/modules/Packages.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/packa…
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/packager/src/modules/Packages.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/packager/src/modules/Packages.ycp Mon Jul 25 11:04:52 2011
@@ -1751,6 +1751,24 @@
any old_packages_proposal = nil;
/**
+ * Check whether the list of needed packages has been changed since the last
+ * package proposal
+ *
+ * @return boolean true if PackagesProposal has been changed
+ */
+global boolean PackagesProposalChanged()
+{
+ any new_packages_proposal = PackagesProposal::GetAllResolvablesForAllTypes();
+
+ // Force reinit
+ boolean changed = new_packages_proposal != old_packages_proposal;
+ y2milestone ("PackagesProposal has been changed: %1", changed);
+ y2debug("PackagesProposal: %1 -> %2", old_packages_proposal, new_packages_proposal);
+
+ return changed;
+}
+
+/**
* Make a proposal for package selection
*
* @param force reset (fully resets the proposal and creates a new one)
@@ -1762,13 +1780,10 @@
// Handle the default desktop
DefaultDesktop::Init();
- // If anything has changed
- any new_packages_proposal = PackagesProposal::GetAllResolvablesForAllTypes();
-
// Force reinit
- if (new_packages_proposal != old_packages_proposal) {
- y2milestone ("PackagesProposal have changed");
- old_packages_proposal = new_packages_proposal;
+ if (PackagesProposalChanged()) {
+ old_packages_proposal = PackagesProposal::GetAllResolvablesForAllTypes();
+ y2milestone("Reinit package proposal");
reinit = true;
}
--
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] r64975 - in /branches/SuSE-Code-11-SP2-Branch/autoinstallation: package/autoyast2.changes src/include/autopart.ycp
by ug@svn2.opensuse.org 25 Jul '11
by ug@svn2.opensuse.org 25 Jul '11
25 Jul '11
Author: ug
Date: Mon Jul 25 10:36:49 2011
New Revision: 64975
URL: http://svn.opensuse.org/viewcvs/yast?rev=64975&view=rev
Log:
speed up partition calculation (bnc#620212)
Modified:
branches/SuSE-Code-11-SP2-Branch/autoinstallation/package/autoyast2.changes
branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/include/autopart.ycp
Modified: branches/SuSE-Code-11-SP2-Branch/autoinstallation/package/autoyast2.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/autoi…
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/autoinstallation/package/autoyast2.changes (original)
+++ branches/SuSE-Code-11-SP2-Branch/autoinstallation/package/autoyast2.changes Mon Jul 25 10:36:49 2011
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Mon Jul 25 10:30:56 CEST 2011 - ug(a)suse.de
+
+- speed up partition calculation when a lot partitions are
+ reused (bnc#620212)
+
+-------------------------------------------------------------------
Mon Jul 25 10:06:25 CEST 2011 - ug(a)suse.de
- notification option for scripts added (fate#312674)
Modified: branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/include/autopart.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/autoi…
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/include/autopart.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/include/autopart.ycp Mon Jul 25 10:36:49 2011
@@ -903,7 +903,16 @@
``{
y2milestone( "start: gap section %1", e );
- if( part["max_cyl"]:0 <= e["end"]:0 &&
+ // speed up partitioning calculation (bnc#620212)
+ boolean reuseCondition = true;
+ if( part["create"]:true == false &&
+ (( haskey( part, "partition_nr" ) && part["partition_nr"]:0 != e["nr"]:0 )) ) {
+ y2milestone("gap can't be used. %1 != %2", part["partition_nr"]:0, e["nr"]:0 );
+ reuseCondition = false;
+ }
+
+ if( reuseCondition &&
+ part["max_cyl"]:0 <= e["end"]:0 &&
part["cylinders"]:0 <= e["cylinders"]:0 &&
(!e["extended"]:false && (size(lg["free_pnr"]:[])>0 || ! creation_needed ) ||
e["extended"]:false && size(lg["ext_pnr"]:[])>0)
--
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] r64974 - in /branches/SuSE-Code-11-SP2-Branch/autoinstallation: package/autoyast2.changes src/modules/AutoinstScripts.ycp
by ug@svn2.opensuse.org 25 Jul '11
by ug@svn2.opensuse.org 25 Jul '11
25 Jul '11
Author: ug
Date: Mon Jul 25 10:07:11 2011
New Revision: 64974
URL: http://svn.opensuse.org/viewcvs/yast?rev=64974&view=rev
Log:
notification option for scripts added (fate#312674)
Modified:
branches/SuSE-Code-11-SP2-Branch/autoinstallation/package/autoyast2.changes
branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/modules/AutoinstScripts.ycp
Modified: branches/SuSE-Code-11-SP2-Branch/autoinstallation/package/autoyast2.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/autoi…
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/autoinstallation/package/autoyast2.changes (original)
+++ branches/SuSE-Code-11-SP2-Branch/autoinstallation/package/autoyast2.changes Mon Jul 25 10:07:11 2011
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Mon Jul 25 10:06:25 CEST 2011 - ug(a)suse.de
+
+- notification option for scripts added (fate#312674)
+
+-------------------------------------------------------------------
Fri Jul 22 09:54:01 CEST 2011 - ug(a)suse.de
- passing a type=boolean to an ask-script via $VAL did not work
Modified: branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/modules/AutoinstScripts.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/autoi…
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/modules/AutoinstScripts.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/modules/AutoinstScripts.ycp Mon Jul 25 10:07:11 2011
@@ -137,6 +137,7 @@
"source":p["source"]:"",
"location":p["location"]:"",
"feedback":p["feedback"]:false,
+ "notification":p["notification"]:"",
"debug":p["debug"]:true
]);
});
@@ -147,6 +148,7 @@
"location":p["location"]:"",
"feedback":p["feedback"]:false,
"debug":p["debug"]:true,
+ "notification":p["notification"]:"",
"network_needed":p["network_needed"]:false
]
);
@@ -158,6 +160,7 @@
"chrooted":p["chrooted"]:false,
"location":p["location"]:"",
"feedback":p["feedback"]:false,
+ "notification":p["notification"]:"",
"debug":p["debug"]:true
]);
});
@@ -317,6 +320,7 @@
string source,
string interpreter,
string type,
+ string notification,
boolean chrooted,
boolean debug,
boolean feedback,
@@ -337,6 +341,7 @@
oldScript=add(oldScript,"debug",debug);
oldScript=add(oldScript,"feedback",feedback);
oldScript=add(oldScript,"network_needed",network);
+ oldScript=add(oldScript,"notification", notification);
mod = true;
return oldScript;
@@ -357,6 +362,7 @@
script=add(script,"debug",debug);
script=add(script,"feedback",feedback);
script=add(script,"network_needed",network);
+ script=add(script,"notification", notification);
merged=add(merged,script);
}
@@ -684,6 +690,9 @@
string executionString = "";
boolean showFeedback = s["feedback"]:false;
+ if( s["notification"]:"" != "" )
+ Popup::ShowFeedback( "", s["notification"]:"" );
+
if (scriptInterpreter == "shell")
{
string debug = ( s["debug"]:true ? "-x" : "" );
@@ -731,6 +740,9 @@
}
string feedback = "";
+ if( s["notification"]:"" != "" )
+ Popup::ClearFeedback();
+
if( executionString != "" ) {
if( showFeedback ) {
feedback = (string)SCR::Read(.target.string, current_logdir+"/"+scriptName+".log" );
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0