YaST Commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
July 2011
- 19 participants
- 410 discussions
[yast-commit] r64973 - /tags/branch-Code-11-SP2-2_17_101/yast2/
by jsuchome@svn2.opensuse.org 25 Jul '11
by jsuchome@svn2.opensuse.org 25 Jul '11
25 Jul '11
Author: jsuchome
Date: Mon Jul 25 09:18:24 2011
New Revision: 64973
URL: http://svn.opensuse.org/viewcvs/yast?rev=64973&view=rev
Log:
Created tag branch-Code-11-SP2-2_17_101 for yast2
Added:
tags/branch-Code-11-SP2-2_17_101/yast2/ (props changed)
- copied from r64972, branches/SuSE-Code-11-SP2-Branch/yast2/
--
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] r64972 - in /branches/SuSE-Code-11-SP2-Branch/yast2: VERSION library/control/src/ProductProfile.ycp package/yast2.changes
by jsuchome@svn2.opensuse.org 25 Jul '11
by jsuchome@svn2.opensuse.org 25 Jul '11
25 Jul '11
Author: jsuchome
Date: Mon Jul 25 09:18:15 2011
New Revision: 64972
URL: http://svn.opensuse.org/viewcvs/yast?rev=64972&view=rev
Log:
- do not use SourceProvideSignedFile for product profile
(bnc#706646)
- 2.17.101
Modified:
branches/SuSE-Code-11-SP2-Branch/yast2/VERSION
branches/SuSE-Code-11-SP2-Branch/yast2/library/control/src/ProductProfile.ycp
branches/SuSE-Code-11-SP2-Branch/yast2/package/yast2.changes
Modified: branches/SuSE-Code-11-SP2-Branch/yast2/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/yast2…
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/yast2/VERSION (original)
+++ branches/SuSE-Code-11-SP2-Branch/yast2/VERSION Mon Jul 25 09:18:15 2011
@@ -1 +1 @@
-2.17.100
+2.17.101
Modified: branches/SuSE-Code-11-SP2-Branch/yast2/library/control/src/ProductProfile.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/yast2…
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/yast2/library/control/src/ProductProfile.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/yast2/library/control/src/ProductProfile.ycp Mon Jul 25 09:18:15 2011
@@ -92,7 +92,7 @@
compliance_checked[src_id] = true;
- string profile = Pkg::SourceProvideSignedFile (src_id, 1, profile_path, true);
+ string profile = Pkg::SourceProvideOptionalFile (src_id, 1, profile_path);
if (profile != nil)
{
profiles = add (profiles, profile);
Modified: branches/SuSE-Code-11-SP2-Branch/yast2/package/yast2.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/yast2…
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/yast2/package/yast2.changes (original)
+++ branches/SuSE-Code-11-SP2-Branch/yast2/package/yast2.changes Mon Jul 25 09:18:15 2011
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Fri Jul 22 16:09:08 CEST 2011 - jsuchome(a)suse.cz
+
+- do not use SourceProvideSignedFile for product profile
+ (bnc#706646)
+- 2.17.101
+
+-------------------------------------------------------------------
Fri Jun 24 09:15:27 CEST 2011 - jsuchome(a)suse.cz
- show different popup when adding add-on,
--
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] r64971 - in /trunk/gtk/src: pkg/ygtkcellrenderersidebutton.c pkg/ygtkpkgdetailview.cc ygtkimage.c
by rpmcruz@svn2.opensuse.org 24 Jul '11
by rpmcruz@svn2.opensuse.org 24 Jul '11
24 Jul '11
Author: rpmcruz
Date: Sun Jul 24 04:03:33 2011
New Revision: 64971
URL: http://svn.opensuse.org/viewcvs/yast?rev=64971&view=rev
Log:
bug fix: gray out disabled images.
bug fix: layout issues with the Dependencies table on sw_single.
Modified:
trunk/gtk/src/pkg/ygtkcellrenderersidebutton.c
trunk/gtk/src/pkg/ygtkpkgdetailview.cc
trunk/gtk/src/ygtkimage.c
Modified: trunk/gtk/src/pkg/ygtkcellrenderersidebutton.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkcellrendererside…
==============================================================================
--- trunk/gtk/src/pkg/ygtkcellrenderersidebutton.c (original)
+++ trunk/gtk/src/pkg/ygtkcellrenderersidebutton.c Sun Jul 24 04:03:33 2011
@@ -19,6 +19,8 @@
G_DEFINE_TYPE (YGtkCellRendererSideButton, ygtk_cell_renderer_side_button, GTK_TYPE_CELL_RENDERER_TEXT)
+#define DEPRESS_PAD 1
+
static void ygtk_cell_renderer_side_button_init (YGtkCellRendererSideButton *bcell)
{ g_object_set(GTK_CELL_RENDERER(bcell), "mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE, NULL); }
@@ -156,8 +158,7 @@
icon_area.x += 2;
icon_area.y += 2;
if (bcell->active) {
- icon_area.x += 2;
- icon_area.y += 2;
+ icon_area.x += DEPRESS_PAD; icon_area.y += DEPRESS_PAD;
}
ensure_pixbuf (bcell, widget);
Modified: trunk/gtk/src/pkg/ygtkpkgdetailview.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgdetailview.cc…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgdetailview.cc (original)
+++ trunk/gtk/src/pkg/ygtkpkgdetailview.cc Sun Jul 24 04:03:33 2011
@@ -647,17 +647,21 @@
virtual void setList (Ypp::List list)
{
if (list.size() == 1) {
- gtk_widget_show (expander);
-
Ypp::Selectable sel = list.get (0);
Ypp::Package pkg (sel);
+ int support = pkg.support();
+
std::string label ("<b>" + std::string (_("Supportability:")) + "</b> ");
- label += Ypp::Package::supportSummary (pkg.support());
+ label += Ypp::Package::supportSummary (support);
gtk_expander_set_label (GTK_EXPANDER (expander), label.c_str());
-
ygtk_rich_text_set_text (YGTK_RICH_TEXT (text),
- Ypp::Package::supportDescription (pkg.support()).c_str());
+ Ypp::Package::supportDescription (support).c_str());
+
+ if (support == 0)
+ gtk_widget_hide(expander);
+ else
+ gtk_widget_show (expander);
}
else
gtk_widget_hide (expander);
@@ -665,20 +669,22 @@
};
struct DependenciesExpander : public DetailExpander {
- GtkWidget *vbox;
+ GtkWidget *grid;
DependenciesExpander()
: DetailExpander (_("Dependencies"), false)
{
- vbox = gtk_vbox_new (FALSE, 6);
- setChild (vbox);
+ grid = gtk_grid_new();
+ gtk_widget_set_hexpand (grid, TRUE);
+ gtk_widget_set_vexpand (grid, FALSE);
+ setChild (grid);
}
void clear()
{
- GList *children = gtk_container_get_children (GTK_CONTAINER (vbox));
+ GList *children = gtk_container_get_children (GTK_CONTAINER (grid));
for (GList *i = children; i; i = i->next)
- gtk_container_remove (GTK_CONTAINER (vbox), (GtkWidget *) i->data);
+ gtk_container_remove (GTK_CONTAINER (grid), (GtkWidget *) i->data);
g_list_free (children);
}
@@ -688,37 +694,31 @@
// if (dep >= 0)
// gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new(), FALSE, TRUE, 0);
- GtkWidget *hbox = gtk_hbox_new (FALSE, 6);
- GtkWidget *col;
- col = ygtk_rich_text_new();
- gtk_widget_set_size_request (col, 100, -1);
- ygtk_rich_text_set_text (YGTK_RICH_TEXT (col),
- ("<i>" + col1 + "</i>").c_str());
- gtk_box_pack_start (GTK_BOX (hbox), col, FALSE, TRUE, 0);
- // by settings both the two following "col" text widgets with the same
- // fixed width, and expanded=True, we ensure all rows have the same size
- col = ygtk_rich_text_new();
- gtk_widget_set_size_request (col, 80, -1);
- ygtk_rich_text_set_text (YGTK_RICH_TEXT (col), col2.c_str());
- if (dep == 0)
- g_signal_connect (G_OBJECT (col), "link-clicked",
- G_CALLBACK (requires_link_cb), NULL);
- else if (dep == 2)
- g_signal_connect (G_OBJECT (col), "link-clicked",
- G_CALLBACK (provides_link_cb), NULL);
- gtk_box_pack_start (GTK_BOX (hbox), col, TRUE, TRUE, 0);
- col = ygtk_rich_text_new();
- gtk_widget_set_size_request (col, 80, -1);
- ygtk_rich_text_set_text (YGTK_RICH_TEXT (col), col3.c_str());
- if (dep == 0)
- g_signal_connect (G_OBJECT (col), "link-clicked",
- G_CALLBACK (requires_link_cb), NULL);
- else if (dep == 2)
- g_signal_connect (G_OBJECT (col), "link-clicked",
- G_CALLBACK (provides_link_cb), NULL);
- gtk_box_pack_start (GTK_BOX (hbox), col, TRUE, TRUE, 0);
+ GtkWidget *cols[3];
+ for(int i = 0; i < 3; i++) {
+ cols[i] = ygtk_rich_text_new();
+ gtk_widget_set_size_request(cols[i], 100, -1);
+ }
+
+ ygtk_rich_text_set_text (YGTK_RICH_TEXT (cols[0]), ("<i>" + col1 + "</i>").c_str());
+ ygtk_rich_text_set_text (YGTK_RICH_TEXT (cols[1]), col2.c_str());
+ ygtk_rich_text_set_text (YGTK_RICH_TEXT (cols[2]), col3.c_str());
+
+ for(int i = 1; i < 3; i++) {
+ if (dep == 0)
+ g_signal_connect (G_OBJECT (cols[i]), "link-clicked",
+ G_CALLBACK (requires_link_cb), NULL);
+ else if (dep == 2)
+ g_signal_connect (G_OBJECT (cols[i]), "link-clicked",
+ G_CALLBACK (provides_link_cb), NULL);
+ }
+
+ GList *children = gtk_container_get_children(GTK_CONTAINER(grid));
+ guint top = g_list_length (children) / 3;
+ g_list_free (children);
- gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
+ for(int i = 0; i < 3; i++)
+ gtk_grid_attach (GTK_GRID (grid), cols[i], i, top, 1, 1);
}
static void requires_link_cb (GtkWidget *widget, const gchar *link)
@@ -754,7 +754,7 @@
if (!inst.empty() || !cand.empty())
addLine (VersionDependencies::getLabel (dep), inst, cand, dep);
}
- gtk_widget_show_all (vbox);
+ gtk_widget_show_all (grid);
}
virtual void showRefreshList (Ypp::List list)
Modified: trunk/gtk/src/ygtkimage.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkimage.c?rev=64971&r1…
==============================================================================
--- trunk/gtk/src/ygtkimage.c (original)
+++ trunk/gtk/src/ygtkimage.c Sun Jul 24 04:03:33 2011
@@ -211,14 +211,19 @@
}
static GdkPixbuf *ygtk_image_render_state (GtkWidget *widget, GdkPixbuf *pixbuf)
-{
- // as in GtkImage
+{ // as in GtkImage
GtkIconSource *source = gtk_icon_source_new();
+ GtkStyleContext *style = gtk_widget_get_style_context (widget);
+ gtk_style_context_save (style);
+ gtk_style_context_set_state (style, gtk_widget_get_state_flags (widget));
+
GdkPixbuf *rendered;
gtk_icon_source_set_pixbuf (source, pixbuf);
gtk_icon_source_set_size (source, GTK_ICON_SIZE_SMALL_TOOLBAR);
gtk_icon_source_set_size_wildcarded (source, FALSE);
- rendered = gtk_render_icon_pixbuf (gtk_widget_get_style_context(widget), source, (GtkIconSize)-1);
+ rendered = gtk_render_icon_pixbuf (style, source, (GtkIconSize)-1);
+
+ gtk_style_context_restore (style);
gtk_icon_source_free (source);
return rendered;
}
@@ -256,7 +261,7 @@
else
pixbuf = image->pixbuf;
- gboolean needs_transform = gtk_widget_get_state (widget) != GTK_STATE_NORMAL;
+ gboolean needs_transform = gtk_widget_get_state_flags (widget) & GTK_STATE_FLAG_INSENSITIVE;
if (needs_transform)
pixbuf = ygtk_image_render_state (widget, pixbuf);
int x = 0, y = 0;
@@ -292,6 +297,12 @@
return FALSE;
}
+static void ygtk_image_state_flags_changed (GtkWidget *widget, GtkStateFlags old_flags)
+{
+ // it seems like we need to force a redraw in gtk3 when state changes
+ gtk_widget_queue_draw (widget);
+}
+
GtkWidget* ygtk_image_new (void)
{
return g_object_new (YGTK_TYPE_IMAGE, NULL);
@@ -304,5 +315,6 @@
widget_class->get_preferred_width = ygtk_image_get_preferred_width;
widget_class->get_preferred_height = ygtk_image_get_preferred_height;
widget_class->destroy = ygtk_image_destroy;
+ widget_class->state_flags_changed = ygtk_image_state_flags_changed;
}
--
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] r64970 - in /trunk/gtk/src/pkg: pkg-selector-help.cc ygtkpkgmenubar.cc
by rpmcruz@svn2.opensuse.org 23 Jul '11
by rpmcruz@svn2.opensuse.org 23 Jul '11
23 Jul '11
Author: rpmcruz
Date: Sat Jul 23 07:59:06 2011
New Revision: 64970
URL: http://svn.opensuse.org/viewcvs/yast?rev=64970&view=rev
Log:
Fixed a couple of typos (bnc#703105)
Modified:
trunk/gtk/src/pkg/pkg-selector-help.cc
trunk/gtk/src/pkg/ygtkpkgmenubar.cc
Modified: trunk/gtk/src/pkg/pkg-selector-help.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/pkg-selector-help.cc…
==============================================================================
--- trunk/gtk/src/pkg/pkg-selector-help.cc (original)
+++ trunk/gtk/src/pkg/pkg-selector-help.cc Sat Jul 23 07:59:06 2011
@@ -16,7 +16,7 @@
"if needed. The user need not be concerned about such underlying <i>dependencies</i>. "
"Likewise, the plugins and other non-essential data of a given application may "
"be shipped in their own packages, so the user may install them only if needed.</p>"),
- _("<p>Common suffixes for complementory packages:</p>"
+ _("<p>Common suffixes for complementary packages:</p>"
"<ul>"
"<li><b>-plugin-</b>: extends the application with extra functionality.</li>"
"<li><b>-devel</b>: headers for software development.</li>"
Modified: trunk/gtk/src/pkg/ygtkpkgmenubar.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgmenubar.cc?re…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgmenubar.cc (original)
+++ trunk/gtk/src/pkg/ygtkpkgmenubar.cc Sat Jul 23 07:59:06 2011
@@ -749,7 +749,7 @@
append_menu_item (submenu, _("Install All Matching -&devel Packages"), NULL,
G_CALLBACK (install_all_devel_pkgs_cb), this);
// Translators: keep "-debug-_info" untranslated
- append_menu_item (submenu, _("Install All Matching -debug-&sinfo Packages"), NULL,
+ append_menu_item (submenu, _("Install All Matching -debug-&info Packages"), NULL,
G_CALLBACK (install_all_debug_info_pkgs_cb), this);
// Translators: keep "-debug-_source" untranslated
append_menu_item (submenu, _("Install All Matching -debug-&source Packages"), NULL,
--
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] r64969 - in /trunk/gtk: ./ cmake/ cmake/modules/ package/ src/ src/pkg/
by rpmcruz@svn2.opensuse.org 23 Jul '11
by rpmcruz@svn2.opensuse.org 23 Jul '11
23 Jul '11
Author: rpmcruz
Date: Sat Jul 23 07:43:30 2011
New Revision: 64969
URL: http://svn.opensuse.org/viewcvs/yast?rev=64969&view=rev
Log:
- ported to gtk3 (initial work by Duncan)
- don't show unsupported packages when the list is empty
(bnc#704103).
- showing mnemonics characters (bnc#704102).
Added:
trunk/gtk/cmake/
trunk/gtk/cmake/modules/
trunk/gtk/cmake/modules/FindGTK3.cmake
Modified:
trunk/gtk/CMakeLists.txt
trunk/gtk/package/yast2-gtk.changes
trunk/gtk/src/CMakeLists.txt
trunk/gtk/src/YGBarGraph.cc
trunk/gtk/src/YGComboBox.cc
trunk/gtk/src/YGDialog.cc
trunk/gtk/src/YGDumbTab.cc
trunk/gtk/src/YGFrame.cc
trunk/gtk/src/YGImage.cc
trunk/gtk/src/YGLayout.cc
trunk/gtk/src/YGProgressBar.cc
trunk/gtk/src/YGPushButton.cc
trunk/gtk/src/YGSelectionStore.h
trunk/gtk/src/YGText.cc
trunk/gtk/src/YGTreeView.cc
trunk/gtk/src/YGUI.cc
trunk/gtk/src/YGUI.h
trunk/gtk/src/YGUtils.cc
trunk/gtk/src/YGUtils.h
trunk/gtk/src/YGWidget.cc
trunk/gtk/src/pkg/CMakeLists.txt
trunk/gtk/src/pkg/YGPackageSelector.cc
trunk/gtk/src/pkg/ygtkcellrendererbutton.c
trunk/gtk/src/pkg/ygtkcellrendererbutton.h
trunk/gtk/src/pkg/ygtkcellrenderersidebutton.c
trunk/gtk/src/pkg/ygtkcellrenderersidebutton.h
trunk/gtk/src/pkg/ygtkcellrenderertext.c
trunk/gtk/src/pkg/ygtkcellrenderertext.h
trunk/gtk/src/pkg/ygtkpkgdetailview.cc
trunk/gtk/src/pkg/ygtkpkgdetailview.h
trunk/gtk/src/pkg/ygtkpkgfilterview.h
trunk/gtk/src/pkg/ygtkpkghistorydialog.cc
trunk/gtk/src/pkg/ygtkpkghistorydialog.h
trunk/gtk/src/pkg/ygtkpkglistview.cc
trunk/gtk/src/pkg/ygtkpkglistview.h
trunk/gtk/src/pkg/ygtkpkgmenubar.cc
trunk/gtk/src/pkg/ygtkpkgmenubar.h
trunk/gtk/src/pkg/ygtkpkgpatternview.h
trunk/gtk/src/pkg/ygtkpkgproductdialog.cc
trunk/gtk/src/pkg/ygtkpkgproductdialog.h
trunk/gtk/src/pkg/ygtkpkgquerycombo.cc
trunk/gtk/src/pkg/ygtkpkgquerycombo.h
trunk/gtk/src/pkg/ygtkpkgquerywidget.h
trunk/gtk/src/pkg/ygtkpkgrpmgroupsview.h
trunk/gtk/src/pkg/ygtkpkgsearchentry.cc
trunk/gtk/src/pkg/ygtkpkgstatusbar.cc
trunk/gtk/src/pkg/ygtkpkgstatusbar.h
trunk/gtk/src/pkg/ygtkpkgundolist.cc
trunk/gtk/src/pkg/ygtkpkgvestigialdialog.h
trunk/gtk/src/pkg/ygtktreemodel.h
trunk/gtk/src/ygdkmngloader.c
trunk/gtk/src/ygtkbargraph.c
trunk/gtk/src/ygtkbargraph.h
trunk/gtk/src/ygtkfieldentry.c
trunk/gtk/src/ygtkfieldentry.h
trunk/gtk/src/ygtkfixed.c
trunk/gtk/src/ygtkfixed.h
trunk/gtk/src/ygtkhtmlwrap.c
trunk/gtk/src/ygtkhtmlwrap.h
trunk/gtk/src/ygtkimage.c
trunk/gtk/src/ygtkimage.h
trunk/gtk/src/ygtklinklabel.c
trunk/gtk/src/ygtklinklabel.h
trunk/gtk/src/ygtkmenubutton.c
trunk/gtk/src/ygtkmenubutton.h
trunk/gtk/src/ygtkratiobox.c
trunk/gtk/src/ygtkratiobox.h
trunk/gtk/src/ygtkrichtext.c
trunk/gtk/src/ygtksteps.c
trunk/gtk/src/ygtksteps.h
trunk/gtk/src/ygtktextview.h
trunk/gtk/src/ygtktimezonepicker.c
trunk/gtk/src/ygtktimezonepicker.h
trunk/gtk/src/ygtktreeview.c
trunk/gtk/src/ygtktreeview.h
trunk/gtk/src/ygtkwizard.c
trunk/gtk/src/ygtkwizard.h
Modified: trunk/gtk/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/CMakeLists.txt?rev=64969&r1=…
==============================================================================
--- trunk/gtk/CMakeLists.txt (original)
+++ trunk/gtk/CMakeLists.txt Sat Jul 23 07:43:30 2011
@@ -2,16 +2,16 @@
cmake_minimum_required (VERSION 2.4)
project (yast2-gtk)
-
+SET( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
## configure
-find_package (GTK2 REQUIRED gtk)
+find_package (GTK3 REQUIRED gtk)
find_package (Libyui REQUIRED)
find_package (Zypp REQUIRED)
-# debug while GTK2 support is shaky
-message (STATUS "GTK2 includes:" ${GTK2_INCLUDE_DIRS})
-message (STATUS "GTK2 libraries:" ${GTK2_LIBRARIES})
+# ricardo: debug gtk cmake
+message (STATUS "GTK3 includes:" ${GTK3_INCLUDE_DIRS})
+message (STATUS "GTK3 libraries:" ${GTK3_LIBRARIES})
# set libyui and libzypp versions
execute_process (COMMAND pkg-config --modversion yast2-libyui COMMAND awk -F. "{ printf \"%d\", ($1 * 1000 + $2) * 1000 + $3;}" OUTPUT_VARIABLE YAST2_VERSION)
Added: trunk/gtk/cmake/modules/FindGTK3.cmake
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/cmake/modules/FindGTK3.cmake…
==============================================================================
--- trunk/gtk/cmake/modules/FindGTK3.cmake (added)
+++ trunk/gtk/cmake/modules/FindGTK3.cmake Sat Jul 23 07:43:30 2011
@@ -0,0 +1,47 @@
+# - Try to find GTK3
+# Once done this will define
+#
+# GTK3_FOUND - System has GTK3
+# GTK3_INCLUDE_DIR - The GTK3 include directory
+# GTK3_LIBRARIES - The libraries needed to use GTK3
+# GTK3_DEFINITIONS - Compiler switches required for using GTK3
+#=============================================================================
+# Copyright 2011 Duncan Mac-Vicar P. <duncan(a)kde.org>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# use pkg-config to get the directories and then use these values
+# in the FIND_PATH() and FIND_LIBRARY() calls
+FIND_PACKAGE(PkgConfig)
+PKG_CHECK_MODULES(PC_GTK3 gtk+-3.0 QUIET)
+SET(GTK3_DEFINITIONS ${PC_GTK3_CFLAGS_OTHER})
+
+FIND_PATH(GTK3_INCLUDE_DIR NAMES "gtk/gtk.h"
+ HINTS
+ ${PC_GTK3_INCLUDEDIR}
+ ${PC_GTK3_INCLUDE_DIRS}
+ PATH_SUFFIXES "gtk-3.0"
+ )
+SET(GTK3_INCLUDE_DIRS ${PC_GTK3_INCLUDE_DIRS})
+
+FIND_LIBRARY(GTK3_LIBRARIES NAMES gtk-3 gtk3
+ HINTS
+ ${PC_GTK3_LIBDIR}
+ ${PC_GTK3_LIBRARY_DIRS}
+ )
+
+# handle the QUIETLY and REQUIRED arguments and set GTK3_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTK3 DEFAULT_MSG GTK3_LIBRARIES GTK3_INCLUDE_DIR)
+
+MARK_AS_ADVANCED(GTK3_INCLUDE_DIR GTK3_LIBRARIES)
+
Modified: trunk/gtk/package/yast2-gtk.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/package/yast2-gtk.changes?re…
==============================================================================
--- trunk/gtk/package/yast2-gtk.changes (original)
+++ trunk/gtk/package/yast2-gtk.changes Sat Jul 23 07:43:30 2011
@@ -1,4 +1,13 @@
-------------------------------------------------------------------
+Sat Jul 23 06:35:00 WET 2011 - rpmcruz(a)alunos.dcc.fc.up.pt
+
+- 2.22.0
+- ported to gtk3
+- don't show unsupported packages when the list is empty
+(bnc#704103).
+- showing mnemonics characters (bnc#704102).
+
+-------------------------------------------------------------------
Sat Apr 16 13:51:00 WET 2011 - rpmcruz(a)alunos.dcc.fc.up.pt
- 2.21.96
Modified: trunk/gtk/src/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/CMakeLists.txt?rev=64969…
==============================================================================
--- trunk/gtk/src/CMakeLists.txt (original)
+++ trunk/gtk/src/CMakeLists.txt Sat Jul 23 07:43:30 2011
@@ -1,5 +1,9 @@
## Makefile.am
+add_definitions()
+
+include_directories(${GTK3_INCLUDE_DIRS})
+
set (gtk_yast_plugin_SRCS
YGBarGraph.cc
YGComboBox.cc
@@ -43,7 +47,7 @@
## includes:
include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
-include_directories (${GTK2_INCLUDE_DIRS})
+include_directories (${GTK3_INCLUDE_DIRS})
include_directories (${LIBYUI_INCLUDE_DIR})
## target:
@@ -52,10 +56,10 @@
## libraries:
-target_link_libraries (py2gtk ${GTK2_LIBRARIES})
+target_link_libraries (py2gtk ${GTK3_LIBRARIES})
target_link_libraries (py2gtk ${LIBYUI_LIBRARY})
set_target_properties (py2gtk PROPERTIES SOVERSION 2)
-set_target_properties (py2gtk PROPERTIES LINK_FLAGS "--no-undefined")
+#set_target_properties (py2gtk PROPERTIES LINK_FLAGS "--no-undefined")
## install:
@@ -69,6 +73,6 @@
add_executable (test test.cc)
add_dependencies (test py2gtk)
target_link_libraries (test libpy2gtk.so)
-target_link_libraries (test ${GTK2_LIBRARIES})
+target_link_libraries (test ${GTK3_LIBRARIES})
target_link_libraries (test ${LIBYUI_LIBRARY})
Modified: trunk/gtk/src/YGBarGraph.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGBarGraph.cc?rev=64969&…
==============================================================================
--- trunk/gtk/src/YGBarGraph.cc (original)
+++ trunk/gtk/src/YGBarGraph.cc Sat Jul 23 07:43:30 2011
@@ -26,19 +26,19 @@
const YBarGraphSegment &s = segment (i);
ygtk_bar_graph_setup_entry (graph, i, s.label().c_str(), s.value());
if (s.hasSegmentColor()) {
- GdkColor color = ycolorToGdk (s.segmentColor());
+ GdkRGBA color = ycolorToGdk (s.segmentColor());
ygtk_bar_graph_customize_bg (graph, i, &color);
}
if (s.hasTextColor()) {
- GdkColor color = ycolorToGdk (s.textColor());
+ GdkRGBA color = ycolorToGdk (s.textColor());
ygtk_bar_graph_customize_fg (graph, i, &color);
}
}
}
- static GdkColor ycolorToGdk (const YColor &ycolor)
+ static GdkRGBA ycolorToGdk (const YColor &ycolor)
{
- GdkColor color = { 0, guint16(ycolor.red() << 8), guint16(ycolor.green() << 8), guint16(ycolor.blue() << 8) };
+ GdkRGBA color = { 0, guint16(ycolor.red() << 8), guint16(ycolor.green() << 8), guint16(ycolor.blue() << 8) };
return color;
}
Modified: trunk/gtk/src/YGComboBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGComboBox.cc?rev=64969&…
==============================================================================
--- trunk/gtk/src/YGComboBox.cc (original)
+++ trunk/gtk/src/YGComboBox.cc Sat Jul 23 07:43:30 2011
@@ -16,7 +16,7 @@
YGComboBox (YWidget *parent, const string &label, bool editable)
: YComboBox (NULL, label, editable),
YGLabeledWidget (this, parent, label, YD_HORIZ,
- editable ? GTK_TYPE_COMBO_BOX_ENTRY : GTK_TYPE_COMBO_BOX, NULL),
+ GTK_TYPE_COMBO_BOX, "has-entry", editable ? TRUE : FALSE, NULL),
YGSelectionStore (false)
{
const GType types[2] = { GDK_TYPE_PIXBUF, G_TYPE_STRING };
@@ -29,7 +29,7 @@
"pixbuf", 0, NULL);
if (editable)
- gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (getWidget()), 1);
+ gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX (getWidget()), 1);
else {
cell = gtk_cell_renderer_text_new();
gtk_cell_layout_pack_end (GTK_CELL_LAYOUT (getWidget()), cell, TRUE);
@@ -87,16 +87,18 @@
virtual std::string text()
{
+ GtkTreeIter iter;
gchar *str;
- if (GTK_IS_COMBO_BOX_ENTRY (getWidget()))
- str = gtk_combo_box_get_active_text (getComboBox());
- else {
- GtkTreeIter iter;
- if (gtk_combo_box_get_active_iter (getComboBox(), &iter))
- gtk_tree_model_get (getModel(), &iter, 1, &str, -1);
- else
- return "";
+ if (editable()) {
+ // HACK: this seems to be necessary
+ GtkWidget *entry = gtk_bin_get_child (GTK_BIN (getWidget()));
+ return gtk_entry_get_text (GTK_ENTRY (entry));
}
+ else
+ if (gtk_combo_box_get_active_iter (getComboBox(), &iter))
+ gtk_tree_model_get (getModel(), &iter, 1, &str, -1);
+ else
+ return "";
std::string ret (str);
g_free (str);
return ret;
Modified: trunk/gtk/src/YGDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGDialog.cc?rev=64969&r1…
==============================================================================
--- trunk/gtk/src/YGDialog.cc (original)
+++ trunk/gtk/src/YGDialog.cc Sat Jul 23 07:43:30 2011
@@ -52,6 +52,7 @@
m_widget = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_object_ref_sink (G_OBJECT (m_widget));
g_object_set (G_OBJECT (m_widget), "allow-shrink", TRUE, NULL);
+ gtk_window_set_has_resize_grip (GTK_WINDOW (m_widget), TRUE);
m_refcount = 0;
m_child = NULL;
@@ -140,7 +141,7 @@
{
setChild (NULL);
if (m_busyCursor)
- gdk_cursor_unref (m_busyCursor);
+ g_object_unref (G_OBJECT (m_busyCursor));
gtk_widget_destroy (m_widget);
g_object_unref (G_OBJECT (m_widget));
}
@@ -151,7 +152,7 @@
void normalCursor()
{
if (m_isBusy)
- gdk_window_set_cursor (m_widget->window, NULL);
+ gdk_window_set_cursor (gtk_widget_get_window(m_widget), NULL);
m_isBusy = false;
}
@@ -160,10 +161,10 @@
if (!m_busyCursor) {
GdkDisplay *display = gtk_widget_get_display (m_widget);
m_busyCursor = gdk_cursor_new_for_display (display, GDK_WATCH);
- gdk_cursor_ref (m_busyCursor);
+ g_object_ref (G_OBJECT (m_busyCursor));
}
if (!m_isBusy)
- gdk_window_set_cursor (m_widget->window, m_busyCursor);
+ gdk_window_set_cursor (gtk_widget_get_window(m_widget), m_busyCursor);
m_isBusy = true;
}
@@ -218,16 +219,16 @@
YGWindow *pThis)
{
// if not main dialog, close it on escape
- if (event->keyval == GDK_Escape &&
+ if (event->keyval == GDK_KEY_Escape &&
/* not main window */ main_window != pThis) {
pThis->close();
return TRUE;
-
+
}
if (event->state & GDK_SHIFT_MASK) {
switch (event->keyval) {
- case GDK_F8:
+ case GDK_KEY_F8:
YGUI::ui()->askSaveLogs();
return TRUE;
default:
@@ -238,35 +239,23 @@
&& (event->state & GDK_MOD1_MASK)) {
yuiMilestone() << "Caught YaST2 magic key combination\n";
switch (event->keyval) {
- case GDK_S:
+ case GDK_KEY_S:
YGUI::ui()->makeScreenShot();
return TRUE;
- case GDK_M:
+ case GDK_KEY_M:
YGUI::ui()->toggleRecordMacro();
return TRUE;
- case GDK_P:
+ case GDK_KEY_P:
YGUI::ui()->askPlayMacro();
return TRUE;
- case GDK_D:
+ case GDK_KEY_D:
YGUI::ui()->sendEvent (new YDebugEvent());
return TRUE;
- case GDK_X:
+ case GDK_KEY_X:
yuiMilestone() << "Starting xterm\n";
(void) system ("/usr/bin/xterm &");
return TRUE;
- case GDK_H:
- dumpYastHtml (pThis->getChild());
- return TRUE;
- case GDK_E: // easter egg
- static guint explode_timeout = 0;
- if (explode_timeout == 0)
- explode_timeout = g_timeout_add (10000, expode_window_timeout_cb, pThis);
- else {
- g_source_remove (explode_timeout);
- explode_timeout = 0;
- }
- return TRUE;
- case GDK_Y:
+ case GDK_KEY_Y:
yuiMilestone() << "Opening dialog spy" << endl;
YDialogSpy::showDialogSpy();
YGUI::ui()->normalCursor();
@@ -283,36 +272,6 @@
static void realize_cb (GtkWidget *widget, YGWindow *pThis)
{ pThis->busyCursor(); }
-
- static gboolean expode_window_timeout_cb (gpointer data)
- {
- YGWindow *pThis = (YGWindow *) data;
- GtkWindow *window = GTK_WINDOW (pThis->m_widget);
- srand (time (NULL));
- gint x, y;
- gtk_window_get_position (window, &x, &y);
- #if 0
- // OVAL MOVE
- for (int i = 180; i < 360+180; i++) {
- gtk_window_move (window, x+(int)(sin((i*G_PI)/180)*50),
- y+(int)(cos((i*G_PI)/180)*50)+50);
- while (gtk_events_pending())
- gtk_main_iteration();
- usleep (25);
- }
- #else
- // EXPLOSION
- for (int i = 0; i < 40; i++) {
- gtk_window_move (window, x+(int)((((float)(rand())/RAND_MAX)*40)-20),
- y+(int)((((float)(rand())/RAND_MAX)*40)-20));
- while (gtk_events_pending())
- gtk_main_iteration();
- usleep (200);
- }
- #endif
- gtk_window_move (window, x, y);
- return TRUE;
- }
};
YGDialog::YGDialog (YDialogType dialogType, YDialogColorMode colorMode)
@@ -416,17 +375,19 @@
// libyui calls YDialog::setSize() to force a geometry recalculation as a
// result of changed layout properties
GtkWidget *window = m_window->getWidget();
- if (GTK_WIDGET_REALIZED (window)) {
+ if (gtk_widget_get_realized (window)) {
gtk_widget_queue_resize (window);
width = MIN (width, YUI::app()->displayWidth());
height = MIN (height, YUI::app()->displayHeight());
#if 1
bool resize = false;
if (isMainDialog()) {
- if (window->allocation.width < width || window->allocation.height < height) {
+ GtkAllocation allocation;
+ gtk_widget_get_allocation(window, &allocation);
+ if (allocation.width < width || allocation.height < height) {
resize = true;
- width = MAX (width, window->allocation.width),
- height = MAX (height, window->allocation.height);
+ width = MAX (width, allocation.width),
+ height = MAX (height, allocation.height);
}
}
else
@@ -442,26 +403,23 @@
void YGDialog::highlight (YWidget *ywidget)
{
struct inner {
- static gboolean expose_highlight_cb (GtkWidget *widget,
- GdkEventExpose *event)
+ static gboolean draw_highlight_cb (GtkWidget *widget, cairo_t *cr)
{
- GtkAllocation *alloc = &widget->allocation;
- int x = alloc->x, y = alloc->y, w = alloc->width, h = alloc->height;
+ int w = gtk_widget_get_allocated_width(widget);
+ int h = gtk_widget_get_allocated_height(widget);
- cairo_t *cr = gdk_cairo_create (widget->window);
- cairo_rectangle (cr, x, y, w, h);
+ cairo_rectangle (cr, 0, 0, w, h);
cairo_set_source_rgb (cr, 0xff/255.0, 0x88/255.0, 0);
cairo_fill (cr);
- cairo_destroy (cr);
return FALSE;
}
static bool hasWindow (GtkWidget *widget)
{
- if (!GTK_WIDGET_NO_WINDOW (widget))
+ if (gtk_widget_get_has_window(widget))
return true;
// widgets like GtkButton add their windows to parent's
- for (GList *children = gdk_window_peek_children (widget->window);
+ for (GList *children = gdk_window_peek_children (gtk_widget_get_window(widget));
children; children = children->next) {
GdkWindow *child = (GdkWindow *) children->data;
gpointer data;
@@ -479,12 +437,12 @@
if (prev) {
GtkWidget *widget = prev->getWidget();
if (inner::hasWindow (widget)) {
- gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, NULL);
- gtk_widget_modify_base (widget, GTK_STATE_NORMAL, NULL);
+ gtk_widget_override_background_color (widget, GTK_STATE_FLAG_NORMAL, NULL);
+ gtk_widget_override_color (widget, GTK_STATE_FLAG_NORMAL, NULL);
}
else {
g_signal_handlers_disconnect_by_func (widget,
- (gpointer) inner::expose_highlight_cb, NULL);
+ (gpointer) inner::draw_highlight_cb, NULL);
gtk_widget_queue_draw (widget);
}
}
@@ -494,14 +452,14 @@
if (ygwidget) {
GtkWidget *widget = ygwidget->getWidget();
if (inner::hasWindow (widget)) {
- GdkColor bg_color = { 0, 0xffff, 0xaaaa, 0 };
- GdkColor base_color = { 0, 0xffff, 0xeeee, 0 };
- gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, &bg_color);
- gtk_widget_modify_base (widget, GTK_STATE_NORMAL, &base_color);
+ GdkRGBA bg_color = { 0, 0xffff, 0xaaaa, 0 };
+ GdkRGBA base_color = { 0, 0xffff, 0xeeee, 0 };
+ gtk_widget_override_background_color (widget, GTK_STATE_FLAG_NORMAL, &bg_color);
+ gtk_widget_override_color (widget, GTK_STATE_FLAG_NORMAL, &base_color);
}
else {
- g_signal_connect (G_OBJECT (widget), "expose-event",
- G_CALLBACK (inner::expose_highlight_cb), NULL);
+ g_signal_connect (G_OBJECT (widget), "draw",
+ G_CALLBACK (inner::draw_highlight_cb), NULL);
gtk_widget_queue_draw (widget);
}
}
Modified: trunk/gtk/src/YGDumbTab.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGDumbTab.cc?rev=64969&r…
==============================================================================
--- trunk/gtk/src/YGDumbTab.cc (original)
+++ trunk/gtk/src/YGDumbTab.cc Sat Jul 23 07:43:30 2011
@@ -8,7 +8,7 @@
#include "YGWidget.h"
#include "YGUtils.h"
#include "YDumbTab.h"
-
+#include <gtk/gtk.h>
#include "ygtkratiobox.h"
class YGDumbTab : public YDumbTab, public YGWidget
@@ -141,7 +141,7 @@
}
// callbacks
- static void switch_page_cb (GtkNotebook *notebook, GtkNotebookPage *page,
+ static void switch_page_cb (GtkNotebook *notebook, GtkWidget *page,
guint tab_nb, YGDumbTab *pThis)
{
GtkWidget *child = gtk_notebook_get_nth_page (notebook, tab_nb);
Modified: trunk/gtk/src/YGFrame.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGFrame.cc?rev=64969&r1=…
==============================================================================
--- trunk/gtk/src/YGFrame.cc (original)
+++ trunk/gtk/src/YGFrame.cc Sat Jul 23 07:43:30 2011
@@ -39,10 +39,10 @@
static GtkWidget *findFirstFocusable (GtkContainer *container)
{
g_return_val_if_fail (container != NULL, NULL);
-
+
for (GList *l = gtk_container_get_children (container);
l; l = l->next) {
- if (GTK_WIDGET_CAN_FOCUS (l->data))
+ if (gtk_widget_get_can_focus (GTK_WIDGET(l->data)))
return GTK_WIDGET (l->data);
else if (GTK_IS_CONTAINER (l->data)) {
GtkWidget *ret = findFirstFocusable (GTK_CONTAINER (l->data));
@@ -130,7 +130,7 @@
virtual void setLabel (const string &_str)
{
GtkWidget *button = gtk_frame_get_label_widget (GTK_FRAME (getWidget()));
- GtkLabel *label = GTK_LABEL (GTK_BIN (button)->child);
+ GtkLabel *label = GTK_LABEL (gtk_bin_get_child(GTK_BIN (button)));
string str (YGUtils::mapKBAccel (_str));
gtk_label_set_text_with_mnemonic (label, str.c_str());
Modified: trunk/gtk/src/YGImage.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGImage.cc?rev=64969&r1=…
==============================================================================
--- trunk/gtk/src/YGImage.cc (original)
+++ trunk/gtk/src/YGImage.cc Sat Jul 23 07:43:30 2011
@@ -35,8 +35,12 @@
stock = GTK_STOCK_DIALOG_WARNING;
else if (endsWith (filename, "/msg_error.png"))
stock = GTK_STOCK_DIALOG_ERROR;
- if (stock && gtk_style_lookup_icon_set (m_widget->style, stock)) {
- GdkPixbuf *pixbuf = gtk_widget_render_icon (m_widget, stock, GTK_ICON_SIZE_DIALOG, NULL);
+
+ GtkStyleContext *ctx;
+ ctx = gtk_widget_get_style_context(m_widget);
+
+ if (stock && gtk_style_context_lookup_icon_set (ctx, stock)) {
+ GdkPixbuf *pixbuf = gtk_widget_render_icon_pixbuf (m_widget, stock, GTK_ICON_SIZE_DIALOG);
ygtk_image_set_from_pixbuf (image, pixbuf);
}
else
Modified: trunk/gtk/src/YGLayout.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGLayout.cc?rev=64969&r1…
==============================================================================
--- trunk/gtk/src/YGLayout.cc (original)
+++ trunk/gtk/src/YGLayout.cc Sat Jul 23 07:43:30 2011
@@ -21,16 +21,17 @@
}
#define YGLAYOUT_INIT \
- ygtk_fixed_setup (YGTK_FIXED (getWidget()), preferred_size_cb, set_size_cb, this);
+ ygtk_fixed_setup (YGTK_FIXED (getWidget()), preferred_width_cb, preferred_height_cb, set_size_cb, this);
#define YGLAYOUT_PREFERRED_SIZE_IMPL(ParentClass) \
- static void preferred_size_cb (YGtkFixed *fixed, gint *width, gint *height, \
- gpointer pThis) { \
- *width = ((ParentClass *) pThis)->ParentClass::preferredWidth(); \
- *height = ((ParentClass *) pThis)->ParentClass::preferredHeight(); \
+ static gint preferred_width_cb (YGtkFixed *fixed, gpointer pThis) { \
+ return ((ParentClass *) pThis)->ParentClass::preferredWidth(); \
+ } \
+ static gint preferred_height_cb (YGtkFixed *fixed, gpointer pThis) { \
+ return ((ParentClass *) pThis)->ParentClass::preferredHeight(); \
}
-#define YGLAYOUT_SET_SIZE_IMPL(ParentClass) \
+#define YGLAYOUT_SET_SIZE_IMPL(ParentClass) \
static void set_size_cb (YGtkFixed *fixed, gint width, gint height, \
- gpointer pThis) { \
+ gpointer pThis) { \
((ParentClass *) pThis)->ParentClass::setSize (width, height); \
} \
virtual void moveChild (YWidget *ychild, int x, int y) \
@@ -161,7 +162,7 @@
if (filename.empty()) {
m_background_pixbuf = 0;
g_signal_handlers_disconnect_by_func (G_OBJECT (getWidget()),
- (void*) expose_event_cb, this);
+ (void*) draw_event_cb, this);
}
else {
GError *error = 0;
@@ -170,27 +171,22 @@
g_warning ("Setting YAlignment background - couldn't load image '%s' - %s",
filename.c_str(), error->message);
else
- g_signal_connect (G_OBJECT (getWidget()), "expose-event",
- G_CALLBACK (expose_event_cb), this);
+ g_signal_connect (G_OBJECT (getWidget()), "draw",
+ G_CALLBACK (draw_event_cb), this);
}
}
- static gboolean expose_event_cb (GtkWidget *widget, GdkEventExpose *event,
- YGAlignment *pThis)
+ static gboolean draw_event_cb (GtkWidget *widget, cairo_t *cr, int width, int height,
+ YGAlignment *pThis)
{
- GtkAllocation *alloc = &widget->allocation;
- cairo_t *cr = gdk_cairo_create (widget->window);
-
gdk_cairo_set_source_pixbuf (cr, pThis->m_background_pixbuf, 0, 0);
cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_REPEAT);
- cairo_rectangle (cr, alloc->x, alloc->y, alloc->width, alloc->height);
+ cairo_rectangle (cr, 0, 0, width, height);
cairo_fill (cr);
- cairo_destroy (cr);
-
- gtk_container_propagate_expose (GTK_CONTAINER (widget),
- GTK_BIN (widget)->child, event);
+ gtk_container_propagate_draw (GTK_CONTAINER (widget),
+ gtk_bin_get_child(GTK_BIN (widget)), cr);
return TRUE;
}
};
@@ -234,7 +230,7 @@
YGWIDGET_IMPL_COMMON (YSpacing)
YGLAYOUT_PREFERRED_SIZE_IMPL (YSpacing)
- static void set_size_cb (YGtkFixed *fixed, gint width, gint height,
+ static void set_size_cb (YGtkFixed *fixed, gint width, gint height,
gpointer pThis) {}
};
Modified: trunk/gtk/src/YGProgressBar.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGProgressBar.cc?rev=649…
==============================================================================
--- trunk/gtk/src/YGProgressBar.cc (original)
+++ trunk/gtk/src/YGProgressBar.cc Sat Jul 23 07:43:30 2011
@@ -137,8 +137,8 @@
ygtk_ratio_box_set_spacing (YGTK_RATIO_BOX (getWidget()), 2);
for (int s = 0; s < segments(); s++) {
GtkWidget *bar = gtk_progress_bar_new();
- gtk_progress_bar_set_orientation (GTK_PROGRESS_BAR (bar),
- horizontal() ? GTK_PROGRESS_LEFT_TO_RIGHT : GTK_PROGRESS_BOTTOM_TO_TOP);
+ gtk_orientable_set_orientation(GTK_ORIENTABLE(bar), horizontal() ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL);
+ gtk_progress_bar_set_inverted(GTK_PROGRESS_BAR (bar), horizontal() ? FALSE : TRUE);
// Progress bars would ask for too much size with weight...
const int min_size = 5;
if (horizontal())
Modified: trunk/gtk/src/YGPushButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGPushButton.cc?rev=6496…
==============================================================================
--- trunk/gtk/src/YGPushButton.cc (original)
+++ trunk/gtk/src/YGPushButton.cc Sat Jul 23 07:43:30 2011
@@ -11,6 +11,7 @@
#include <string.h>
#include <YLayoutBox.h>
+#include "ygtkratiobox.h"
class YGPushButton : public YPushButton, public YGWidget
{
@@ -25,7 +26,7 @@
gtk_button_set_use_underline (GTK_BUTTON (getWidget()), TRUE);
setLabel (label);
connect (getWidget(), "clicked", G_CALLBACK (clicked_cb), this);
- g_signal_connect (getWidget(), "size-request", G_CALLBACK (size_request_cb), this);
+ g_signal_connect (getWidget(), "realize", G_CALLBACK (realize_cb), this);
}
void setStockIcon (const std::string &label)
@@ -135,8 +136,8 @@
YPushButton::setDefaultButton (isDefault);
if (isDefault) {
GtkWidget *button = getWidget();
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
- if (GTK_WIDGET_REALIZED (button))
+ gtk_widget_set_can_default(button, TRUE);
+ if (gtk_widget_get_realized (button))
inner::realize_cb (button);
g_signal_connect (G_OBJECT (button), "realize",
G_CALLBACK (inner::realize_cb), this);
@@ -148,7 +149,7 @@
if (dynamic_cast <YPushButton *> (ywidget)) {
GtkWidget *button = YGWidget::get (ywidget)->getWidget();
GtkWidget *icon = gtk_button_get_image (GTK_BUTTON (button));
- return icon && GTK_WIDGET_VISIBLE (icon);
+ return icon && gtk_widget_get_visible (icon);
}
return true;
}
@@ -165,7 +166,7 @@
for (YWidgetListConstIterator it = ybox->childrenBegin();
it != ybox->childrenEnd(); it++) {
if ((YWidget *) pThis == *it) {
- if (ylast && !hasIcon (ylast))
+ if (ylast && !hasIcon (ylast))
pThis->setIcon ("");
break;
}
@@ -205,13 +206,11 @@
#define DEFAULT_CHILD_MIN_WIDTH 85
#define DEFAULT_CHILD_MIN_HEIGHT 27
- static void size_request_cb (GtkWidget *widget, GtkRequisition *req, YGPushButton *pThis)
+ static void realize_cb (GtkWidget *widget, YGPushButton *pThis)
{ // enlarge button if parent is ButtonBox
YWidget *yparent = pThis->m_ywidget->parent();
- if (yparent && !strcmp (yparent->widgetClass(), "YButtonBox")) {
- req->width = MAX (req->width, DEFAULT_CHILD_MIN_WIDTH);
- req->height = MAX (req->height, DEFAULT_CHILD_MIN_HEIGHT);
- }
+ if (yparent && !strcmp (yparent->widgetClass(), "YButtonBox"))
+ ygtk_adj_size_set_min (YGTK_ADJ_SIZE(pThis->getLayout()), DEFAULT_CHILD_MIN_WIDTH, DEFAULT_CHILD_MIN_HEIGHT);
}
YGWIDGET_IMPL_COMMON (YPushButton)
Modified: trunk/gtk/src/YGSelectionStore.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGSelectionStore.h?rev=6…
==============================================================================
--- trunk/gtk/src/YGSelectionStore.h (original)
+++ trunk/gtk/src/YGSelectionStore.h Sat Jul 23 07:43:30 2011
@@ -7,7 +7,7 @@
#ifndef YGSELECTION_STORE_H
#define YGSELECTION_STORE_H
-#include <gtk/gtktreemodel.h>
+#include <gtk/gtk.h>
struct YItem;
struct YSelectionWidget;
Modified: trunk/gtk/src/YGText.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGText.cc?rev=64969&r1=6…
==============================================================================
--- trunk/gtk/src/YGText.cc (original)
+++ trunk/gtk/src/YGText.cc Sat Jul 23 07:43:30 2011
@@ -74,7 +74,7 @@
void scrollToBottom()
{
#if 1
- YGUtils::scrollWidget (GTK_TEXT_VIEW (getWidget())->vadjustment, false);
+ YGUtils::scrollWidget (gtk_scrollable_get_vadjustment(GTK_SCROLLABLE (getWidget())), false);
#else
GtkTextBuffer *buffer = getBuffer();
GtkTextIter iter;
@@ -167,8 +167,8 @@
if (text.size() == m_text.size()) return;
// appending text: avoid flickering and allow user to scroll freely
- GtkAdjustment *vadj = GTK_TEXT_VIEW (getWidget())->vadjustment;
- bool autoScroll = vadj->value >= vadj->upper - vadj->page_size;
+ GtkAdjustment *vadj = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE (getWidget()));
+ bool autoScroll = gtk_adjustment_get_value(vadj) >= gtk_adjustment_get_upper(vadj) - gtk_adjustment_get_page_size(vadj);
std::string diff (text.substr (m_text.size()));
YGTextView::appendText (diff);
Modified: trunk/gtk/src/YGTreeView.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGTreeView.cc?rev=64969&…
==============================================================================
--- trunk/gtk/src/YGTreeView.cc (original)
+++ trunk/gtk/src/YGTreeView.cc Sat Jul 23 07:43:30 2011
@@ -378,7 +378,7 @@
void setSortable (bool sortable)
{
- if (!sortable && !GTK_WIDGET_REALIZED (getWidget()))
+ if (!sortable && !gtk_widget_get_realized (getWidget()))
return;
int n = 0;
GList *columns = gtk_tree_view_get_columns (getView());
@@ -514,7 +514,7 @@
static gboolean key_press_event_cb (GtkWidget *widget, GdkEventKey *event, YGTable *pThis)
{
- if (event->keyval == GDK_Delete) {
+ if (event->keyval == GDK_KEY_Delete) {
YWidget *button = YGDialog::currentDialog()->getFunctionWidget (5);
if (button)
activateButton (button);
Modified: trunk/gtk/src/YGUI.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUI.cc?rev=64969&r1=649…
==============================================================================
--- trunk/gtk/src/YGUI.cc (original)
+++ trunk/gtk/src/YGUI.cc Sat Jul 23 07:43:30 2011
@@ -356,11 +356,14 @@
return;
}
+ GtkAllocation alloc;
+ gtk_widget_get_allocation(widget, &alloc);
+
GError *error = 0;
GdkPixbuf *shot =
- gdk_pixbuf_get_from_drawable (NULL, GDK_DRAWABLE (widget->window),
- gdk_colormap_get_system(), 0, 0, 0, 0, widget->allocation.width,
- widget->allocation.height);
+ gdk_pixbuf_get_from_window (gtk_widget_get_window(widget),
+ 0, 0, alloc.width,
+ alloc.height);
if (!shot) {
if (interactive)
@@ -601,52 +604,3 @@
YApplication *YGUI::createApplication()
{ return new YGApplication(); }
-#include <YRichText.h>
-#include "ygtktextview.h"
-
-void dumpYastHtml (YWidget *widget)
-{
- struct inner {
- static void dumpYastHtml (YWidget *widget, GtkBox *box)
- {
- YGWidget *ygwidget;
- if (!widget || !(ygwidget = YGWidget::get (widget)))
- return;
-
- YRichText *rtext = dynamic_cast <YRichText *> (widget);
- if (rtext) {
- std::string text = rtext->text();
-
- GtkWidget *view = ygtk_text_view_new (FALSE);
- gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view), GTK_WRAP_WORD);
- GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
- gtk_text_buffer_set_text (buffer, text.c_str(), -1);
-
- GtkWidget *scroll = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll),
- GTK_SHADOW_IN);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_container_add (GTK_CONTAINER (scroll), view);
- gtk_box_pack_start (box, scroll, TRUE, TRUE, 6);
- }
-
- for (YWidgetListConstIterator it = widget->childrenBegin();
- it != widget->childrenEnd(); it++)
- dumpYastHtml (*it, box);
- }
- static void destroy_dialog (GtkDialog *dialog, gint arg)
- { gtk_widget_destroy (GTK_WIDGET (dialog)); }
- };
-
- GtkWidget *dialog = gtk_dialog_new_with_buttons ("YWidgets HTML", NULL,
- GtkDialogFlags (GTK_DIALOG_NO_SEPARATOR), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL);
- gtk_window_set_default_size (GTK_WINDOW (dialog), 400, 300);
-
- inner::dumpYastHtml (widget, GTK_BOX (GTK_DIALOG (dialog)->vbox));
-
- gtk_widget_show_all (dialog);
- g_signal_connect (G_OBJECT (dialog), "response",
- G_CALLBACK (inner::destroy_dialog), 0);
-}
-
Modified: trunk/gtk/src/YGUI.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUI.h?rev=64969&r1=6496…
==============================================================================
--- trunk/gtk/src/YGUI.h (original)
+++ trunk/gtk/src/YGUI.h Sat Jul 23 07:43:30 2011
@@ -72,10 +72,6 @@
bool isSwsingle() const { return m_swsingle; }
};
-// debug helpers.
-void dumpTree (YWidget *widget);
-void dumpYastHtml (YWidget *widget);
-
#include <YWidgetFactory.h>
class YGWidgetFactory : public YWidgetFactory
Modified: trunk/gtk/src/YGUtils.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUtils.cc?rev=64969&r1=…
==============================================================================
--- trunk/gtk/src/YGUtils.cc (original)
+++ trunk/gtk/src/YGUtils.cc Sat Jul 23 07:43:30 2011
@@ -411,14 +411,14 @@
static gboolean scroll_down_cb (void *pData)
{
GtkAdjustment *vadj = (GtkAdjustment *) pData;
- gtk_adjustment_set_value (vadj, vadj->upper - vadj->page_size);
+ gtk_adjustment_set_value (vadj, gtk_adjustment_get_upper(vadj) - gtk_adjustment_get_page_size(vadj));
return FALSE;
}
void YGUtils::scrollWidget (GtkAdjustment *vadj, bool top)
{
if (top)
- gtk_adjustment_set_value (vadj, vadj->lower);
+ gtk_adjustment_set_value (vadj, gtk_adjustment_get_lower(vadj));
else
// since we usually want to call this together with a text change, we
// must wait till that gets in effect
@@ -460,9 +460,10 @@
int YGUtils::getCharsWidth (GtkWidget *widget, int chars_nb)
{
+ GtkStyleContext *style_ctx = gtk_widget_get_style_context(widget);
PangoContext *context = gtk_widget_get_pango_context (widget);
PangoFontMetrics *metrics = pango_context_get_metrics (context,
- widget->style->font_desc, NULL);
+ gtk_style_context_get_font(style_ctx, GTK_STATE_FLAG_NORMAL), NULL);
int width = pango_font_metrics_get_approximate_char_width (metrics);
pango_font_metrics_unref (metrics);
@@ -472,9 +473,10 @@
int YGUtils::getCharsHeight (GtkWidget *widget, int chars_nb)
{
+ GtkStyleContext *style_ctx = gtk_widget_get_style_context(widget);
PangoContext *context = gtk_widget_get_pango_context (widget);
PangoFontMetrics *metrics = pango_context_get_metrics (context,
- widget->style->font_desc, NULL);
+ gtk_style_context_get_font(style_ctx, GTK_STATE_FLAG_NORMAL), NULL);
int height = pango_font_metrics_get_ascent (metrics) +
pango_font_metrics_get_descent (metrics);
@@ -486,13 +488,15 @@
void YGUtils::setWidgetFont (GtkWidget *widget, PangoStyle style, PangoWeight weight,
double scale)
{
- PangoFontDescription *font_desc = widget->style->font_desc;
+ GtkStyleContext *style_ctx = gtk_widget_get_style_context(widget);
+ const PangoFontDescription *font_desc = gtk_style_context_get_font(style_ctx, GTK_STATE_FLAG_NORMAL);
+
int size = pango_font_description_get_size (font_desc);
PangoFontDescription* font = pango_font_description_new();
pango_font_description_set_weight (font, weight);
pango_font_description_set_size (font, (int)(size * scale));
pango_font_description_set_style (font, style);
- gtk_widget_modify_font (widget, font);
+ gtk_widget_override_font (widget, font);
pango_font_description_free (font);
}
@@ -504,10 +508,13 @@
if (!g_object_get_data (G_OBJECT (paned), "init")) { // only once
gdouble rel = GPOINTER_TO_INT (_rel) / 100.;
gint parent_size;
+ GtkAllocation alloc;
+ gtk_widget_get_allocation(paned, &alloc);
+
if (gtk_orientable_get_orientation (GTK_ORIENTABLE (paned)) == GTK_ORIENTATION_HORIZONTAL)
- parent_size = paned->allocation.width;
+ parent_size = alloc.width;
else
- parent_size = paned->allocation.height;
+ parent_size = alloc.height;
int pos = parent_size * rel;
gtk_paned_set_position (GTK_PANED (paned), pos);
g_object_set_data (G_OBJECT (paned), "init", GINT_TO_POINTER (1));
@@ -711,10 +718,12 @@
const char *fallbackIcon)
{
const char *icon = mapStockIcon (label);
+ GtkStyleContext *ctx = gtk_widget_get_style_context(button);
+
if (!icon && label.size() < 22)
icon = fallbackIcon;
if (icon) {
- if (gtk_style_lookup_icon_set (button->style, icon)) {
+ if (gtk_style_context_lookup_icon_set (ctx, icon)) {
// we want to use GtkImage stock mode so it honors sensitive
GtkWidget *image = gtk_image_new_from_stock (icon, GTK_ICON_SIZE_BUTTON);
gtk_button_set_image (GTK_BUTTON (button), image);
@@ -731,19 +740,26 @@
void YGUtils::shrinkWidget (GtkWidget *widget)
{
static bool first_time = true;
+ GtkCssProvider *provider;
+
if (first_time) {
- first_time = false;
- gtk_rc_parse_string (
- "style \"small-widget-style\"\n"
+ provider = gtk_css_provider_new ();
+ gtk_css_provider_load_from_data (provider,
+ "style \"small-widget-style\"\n"
"{\n"
" GtkWidget::focus-padding = 0\n"
" GtkWidget::focus-line-width = 0\n"
" xthickness = 0\n"
" ythickness = 0\n"
"}\n"
- "widget \"*.small-widget\" style \"small-widget-style\"");
- }
- gtk_widget_set_name (widget, "small-widget");
+ "widget \"*.small-widget\" style \"small-widget-style\"", -1, NULL);
+ gtk_style_context_add_provider (gtk_widget_get_style_context (widget),
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_object_unref (provider);
+ gtk_widget_set_name (widget, "small-widget");
+ first_time = false;
+ }
}
/*
@@ -764,7 +780,7 @@
for (; text[i]; i++)
if (text[i] == '>')
break;
-
+
if (!strncasecmp (text+a, "<h", 2) || !strncasecmp (text+a, "<big>", 5) ||
(!str->len && !strncasecmp (text+a, "<b>", 3))) {
for (i++; text[i]; i++) {
Modified: trunk/gtk/src/YGUtils.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUtils.h?rev=64969&r1=6…
==============================================================================
--- trunk/gtk/src/YGUtils.h (original)
+++ trunk/gtk/src/YGUtils.h Sat Jul 23 07:43:30 2011
@@ -7,8 +7,7 @@
#include <string>
#include <list>
-#include <gtk/gtktextview.h>
-#include <gtk/gtkentry.h>
+#include <gtk/gtk.h>
/* YGUtils.h/cc have some functionality that is shared between different parts
of the code. */
Modified: trunk/gtk/src/YGWidget.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGWidget.cc?rev=64969&r1…
==============================================================================
--- trunk/gtk/src/YGWidget.cc (original)
+++ trunk/gtk/src/YGWidget.cc Sat Jul 23 07:43:30 2011
@@ -54,7 +54,7 @@
static void min_size_cb (guint *min_width, guint *min_height, gpointer pData);
YGWidget::YGWidget(YWidget *ywidget, YWidget *yparent,
- GtkType type, const char *property_name, ...)
+ GType type, const char *property_name, ...)
: m_ywidget (ywidget)
{
va_list args;
@@ -157,7 +157,7 @@
{
// We might want to do some caching here..
GtkRequisition req;
- gtk_widget_size_request (m_adj_size, &req);
+ gtk_widget_get_preferred_size (m_adj_size, &req, NULL);
return dimension == YD_HORIZ ? req.width : req.height;
}
Modified: trunk/gtk/src/pkg/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/CMakeLists.txt?rev=6…
==============================================================================
--- trunk/gtk/src/pkg/CMakeLists.txt (original)
+++ trunk/gtk/src/pkg/CMakeLists.txt Sat Jul 23 07:43:30 2011
@@ -43,11 +43,12 @@
## libraries:
target_link_libraries (py2gtk_pkg libpy2gtk.so)
-target_link_libraries (py2gtk_pkg ${GTK2_LIBRARIES})
+target_link_libraries (py2gtk_pkg ${GTK3_LIBRARIES})
target_link_libraries (py2gtk_pkg ${LIBYUI_LIBRARY})
target_link_libraries (py2gtk_pkg ${ZYPP_LIBRARY})
set_target_properties (py2gtk_pkg PROPERTIES SOVERSION 2)
-set_target_properties (py2gtk_pkg PROPERTIES LINK_FLAGS "--no-undefined -Wl,-rpath -Wl,${UI_PLUGIN_DIR}")
+#set_target_properties (py2gtk_pkg PROPERTIES LINK_FLAGS "--no-undefined -Wl,-rpath -Wl,${UI_PLUGIN_DIR}")
+set_target_properties (py2gtk_pkg PROPERTIES LINK_FLAGS "-Wl,-rpath -Wl,${UI_PLUGIN_DIR}")
## install:
Modified: trunk/gtk/src/pkg/YGPackageSelector.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/YGPackageSelector.cc…
==============================================================================
--- trunk/gtk/src/pkg/YGPackageSelector.cc (original)
+++ trunk/gtk/src/pkg/YGPackageSelector.cc Sat Jul 23 07:43:30 2011
@@ -258,7 +258,7 @@
(GTK_SCROLLED_WINDOW (scroll), GTK_SHADOW_IN);
gtk_container_add (GTK_CONTAINER (scroll), view);
- GtkBox *vbox = GTK_BOX (GTK_DIALOG(dialog)->vbox);
+ GtkBox *vbox = GTK_BOX (gtk_dialog_get_content_area(GTK_DIALOG(dialog)));
gtk_box_pack_start (vbox, scroll, TRUE, TRUE, 6);
gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE);
@@ -411,7 +411,7 @@
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll),
GTK_SHADOW_IN);
gtk_container_add (GTK_CONTAINER (scroll), view);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), scroll);
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area(GTK_DIALOG (dialog))), scroll);
gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE);
gtk_window_set_default_size (GTK_WINDOW (dialog), -1, 500);
@@ -603,6 +603,13 @@
{ return Ypp::Package (sel).support() <= 1; }
};
+ Ypp::PoolQuery query (Ypp::Selectable::PACKAGE);
+ query.addCriteria (new Ypp::StatusMatch (Ypp::StatusMatch::TO_MODIFY));
+ query.addCriteria (new UnsupportedMatch());
+ Ypp::List list (query);
+ if(list.size() == 0)
+ return true;
+
GtkWidget *dialog = gtk_message_dialog_new (YGDialog::currentWindow(),
GtkDialogFlags (0), GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE,
_("Unsupported packages"));
@@ -615,11 +622,6 @@
gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE);
gtk_window_set_default_size (GTK_WINDOW (dialog), 600, 500);
- Ypp::PoolQuery query (Ypp::Selectable::PACKAGE);
- query.addCriteria (new Ypp::StatusMatch (Ypp::StatusMatch::TO_MODIFY));
- query.addCriteria (new UnsupportedMatch());
- Ypp::List list (query);
-
YGtkPkgListView view (true, Ypp::List::NAME_SORT, false, true);
view.addCheckColumn (INSTALLED_CHECK_PROP);
view.addTextColumn (_("Name"), NAME_SUMMARY_PROP, true, -1);
@@ -629,7 +631,7 @@
view.setListener (this);
view.setList (list);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), view.getWidget());
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area(GTK_DIALOG (dialog))), view.getWidget());
gtk_widget_show_all (dialog);
int ret = gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
Modified: trunk/gtk/src/pkg/ygtkcellrendererbutton.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkcellrendererbutt…
==============================================================================
--- trunk/gtk/src/pkg/ygtkcellrendererbutton.c (original)
+++ trunk/gtk/src/pkg/ygtkcellrendererbutton.c Sat Jul 23 07:43:30 2011
@@ -31,9 +31,7 @@
{
bcell->active = FALSE;
GtkCellRenderer *cell = GTK_CELL_RENDERER (bcell);
- cell->xpad = BORDER;
- cell->ypad = BORDER;
- cell->mode = GTK_CELL_RENDERER_MODE_ACTIVATABLE;
+ g_object_set(cell, "xpad", BORDER, "ypad", BORDER, "mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE, NULL);
bcell->icon_size = 16;
}
@@ -118,14 +116,19 @@
static PangoLayout *create_layout (YGtkCellRendererButton *bcell, GtkWidget *widget)
{
GtkCellRendererText *tcell = GTK_CELL_RENDERER_TEXT (bcell);
- if (tcell->text)
- return gtk_widget_create_pango_layout (widget, tcell->text);
- return NULL;
+ gchar *text = NULL;
+ g_object_get (G_OBJECT (tcell), "text", &text, NULL);
+ PangoLayout *layout = NULL;
+ if (text) {
+ layout = gtk_widget_create_pango_layout (widget, text);
+ g_free(text);
+ }
+ return layout;
}
static void ensure_pixbuf (YGtkCellRendererButton *cell, GtkWidget *widget)
{
- if ((cell->icon_name || cell->stock_id) && !cell->pixbuf) {
+ if (!cell->pixbuf && (cell->icon_name || cell->stock_id)) {
if (cell->icon_name) {
GtkIconTheme *theme = gtk_icon_theme_get_default();
GError *error = 0;
@@ -136,13 +139,13 @@
cell->icon_name, error->message);
}
else // stock-id
- cell->pixbuf = gtk_widget_render_icon (widget, cell->stock_id,
- GTK_ICON_SIZE_BUTTON, "button");
+ cell->pixbuf = gtk_widget_render_icon_pixbuf (
+ widget, cell->stock_id, GTK_ICON_SIZE_BUTTON);
}
}
static void ygtk_cell_renderer_button_get_size_full (GtkCellRenderer *cell,
- GtkWidget *widget, GdkRectangle *cell_area, gint *_xoffset, gint *_yoffset,
+ GtkWidget *widget, const GdkRectangle *cell_area, gint *_xoffset, gint *_yoffset,
gint *_width, gint *_height, gint *_pixbuf_xoffset, gint *_pixbuf_yoffset,
gint *_pixbuf_width, gint *_pixbuf_height, gint *_text_xoffset, gint *_text_yoffset)
{
@@ -170,28 +173,35 @@
width += PIXBUF_TEXT_SPACING;
height = MAX (pixbuf_height, text_height);
+ gfloat xalign, yalign;
+ guint xpad, ypad;
+ g_object_get(cell,
+ "xalign", &xalign,
+ "yalign", &yalign,
+ "xpad", &xpad,
+ "ypad", &ypad, NULL);
+
if (cell_area) {
gboolean reverse = gtk_widget_get_default_direction() == GTK_TEXT_DIR_RTL;
- gfloat xalign = cell->xalign, yalign = cell->yalign;
if (reverse)
xalign = 1.0 - xalign;
- int cell_width = cell_area->width - cell->xpad*2,
- cell_height = cell_area->height - cell->ypad*2;
- int xoffset = (xalign * (cell_width - width)) + cell->xpad;
- int yoffset = (yalign * (cell_height - height)) + cell->ypad;
+ int cell_width = cell_area->width - xpad*2,
+ cell_height = cell_area->height - ypad*2;
+ int xoffset = (xalign * (cell_width - width)) + xpad;
+ int yoffset = (yalign * (cell_height - height)) + ypad;
if (_xoffset) *_xoffset = xoffset;
if (_yoffset) *_yoffset = yoffset;
int text_x = xoffset, text_y;
if (pixbuf_width && !reverse)
text_x += (pixbuf_width + PIXBUF_TEXT_SPACING);
- text_y = (yalign * (cell_height - text_height)) + cell->ypad;
+ text_y = (yalign * (cell_height - text_height)) + ypad;
int pixbuf_x = xoffset, pixbuf_y;
if (text_width && reverse)
pixbuf_x += (text_width + PIXBUF_TEXT_SPACING);
- pixbuf_y = (yalign * (cell_height - pixbuf_height)) + cell->ypad;
+ pixbuf_y = (yalign * (cell_height - pixbuf_height)) + ypad;
if (_pixbuf_xoffset) *_pixbuf_xoffset = pixbuf_x;
if (_pixbuf_yoffset) *_pixbuf_yoffset = pixbuf_y;
@@ -201,39 +211,37 @@
if (_text_yoffset) *_text_yoffset = text_y;
}
- if (_width) *_width = width + (cell->xpad * 2);
- if (_height) *_height = height + (cell->ypad * 2);
+ if (_width) *_width = width + (xpad * 2);
+ if (_height) *_height = height + (ypad * 2);
}
static void ygtk_cell_renderer_button_get_size (GtkCellRenderer *cell,
- GtkWidget *widget, GdkRectangle *cell_area, gint *xoffset, gint *yoffset,
+ GtkWidget *widget, const GdkRectangle *cell_area, gint *xoffset, gint *yoffset,
gint *width, gint *height)
{
ygtk_cell_renderer_button_get_size_full (cell, widget, cell_area,
xoffset, yoffset, width, height, NULL, NULL, NULL, NULL, NULL, NULL);
}
-static void ygtk_cell_renderer_button_render (GtkCellRenderer *cell,
- GdkDrawable *window, GtkWidget *widget, GdkRectangle *background_area,
- GdkRectangle *cell_area, GdkRectangle *expose_area, GtkCellRendererState flags)
+static void ygtk_cell_renderer_button_render(
+ GtkCellRenderer *cell, cairo_t *cr, GtkWidget *widget,
+ const GdkRectangle *background_area, const GdkRectangle *cell_area,
+ GtkCellRendererState flags)
{
YGtkCellRendererButton *bcell = YGTK_CELL_RENDERER_BUTTON (cell);
- gboolean has_focus = FALSE;
- if (flags & GTK_CELL_RENDERER_SELECTED)
- has_focus = GTK_WIDGET_HAS_FOCUS (widget);
-
GtkStateType state = GTK_STATE_NORMAL;
- if (!cell->sensitive || GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE)
+ if (!gtk_cell_renderer_get_sensitive(cell) || gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE)
state = GTK_STATE_INSENSITIVE;
else if ((flags & GTK_CELL_RENDERER_PRELIT))
state = GTK_STATE_PRELIGHT;
-
- GtkShadowType shadow = GTK_SHADOW_OUT;
- if (bcell->active) {
- shadow = GTK_SHADOW_IN;
+ if (bcell->active)
state = GTK_STATE_ACTIVE;
- }
+
+ GtkStyleContext *style = gtk_widget_get_style_context(widget);
+ gtk_style_context_save(style);
+ gtk_style_context_set_state(style, state);
+ gtk_style_context_add_class (style, GTK_STYLE_CLASS_BUTTON);
int text_xoffset, text_yoffset, pixbuf_xoffset, pixbuf_yoffset, pixbuf_width,
pixbuf_height, width, height;
@@ -245,41 +253,39 @@
int y = cell_area->y + (cell_area->height - height)/2 + OUTER_BORDER;
width -= OUTER_BORDER*2; height -= OUTER_BORDER*2;
- gtk_paint_box (widget->style, window, state, shadow, expose_area, widget,
- "button", x, y, width, height);
+ gtk_render_background (style, cr, x, y, width, height);
+ gtk_render_frame (style, cr, x, y, width, height);
- int cell_area_x = cell_area->x, cell_area_y = cell_area->y;
- if (bcell->active) {
- cell_area->x += DEPRESS_PAD;
- cell_area->y += DEPRESS_PAD;
- }
+ // paint content
- // paint
ensure_pixbuf (bcell, widget);
if (bcell->pixbuf) {
- int x = cell_area->x + pixbuf_xoffset, y = cell_area->y + pixbuf_yoffset;
- cairo_t *cr = gdk_cairo_create (window);
- gdk_cairo_set_source_pixbuf (cr, bcell->pixbuf, x, y);
- cairo_rectangle (cr, x, y, pixbuf_width, pixbuf_height);
+ int _x = x + pixbuf_xoffset, _y = y + pixbuf_yoffset;
+ if (bcell->active) {
+ _x += DEPRESS_PAD; _y += DEPRESS_PAD;
+ }
+ gdk_cairo_set_source_pixbuf (cr, bcell->pixbuf, _x, _y);
+ cairo_rectangle (cr, _x, _y, pixbuf_width, pixbuf_height);
cairo_fill (cr);
- cairo_destroy (cr);
}
PangoLayout *layout = create_layout (bcell, widget);
if (layout) {
- int x = cell_area->x + text_xoffset, y = cell_area->y + text_yoffset;
- GtkStyle *style = gtk_widget_get_style (widget);
- gtk_paint_layout (style, window, state, TRUE, expose_area, widget,
- "cellrenderertext", x, y, layout);
+ int _x = cell_area->x + text_xoffset, _y = cell_area->y + text_yoffset;
+ if (bcell->active) {
+ _x += DEPRESS_PAD; _y += DEPRESS_PAD;
+ }
+
+ gtk_render_layout(style, cr, _x, _y, layout);
g_object_unref (G_OBJECT (layout));
}
- cell_area->x = cell_area_x; cell_area->y = cell_area_y;
+ gtk_style_context_restore(style);
}
static gboolean ygtk_cell_renderer_button_activate (GtkCellRenderer *cell,
- GdkEvent *event, GtkWidget *widget, const gchar *path, GdkRectangle *background_area,
- GdkRectangle *cell_area, GtkCellRendererState flags)
+ GdkEvent *event, GtkWidget *widget, const gchar *path, const GdkRectangle *background_area,
+ const GdkRectangle *cell_area, GtkCellRendererState flags)
{
GdkEventButton *_event = &event->button;
if (_event->x >= cell_area->x && _event->x <= cell_area->x + cell_area->width) {
Modified: trunk/gtk/src/pkg/ygtkcellrendererbutton.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkcellrendererbutt…
==============================================================================
--- trunk/gtk/src/pkg/ygtkcellrendererbutton.h (original)
+++ trunk/gtk/src/pkg/ygtkcellrendererbutton.h Sat Jul 23 07:43:30 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_CELL_RENDERER_BUTTON_H
#define YGTK_CELL_RENDERER_BUTTON_H
-#include <gtk/gtkcellrenderertext.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
#define YGTK_TYPE_CELL_RENDERER_BUTTON (ygtk_cell_renderer_button_get_type ())
Modified: trunk/gtk/src/pkg/ygtkcellrenderersidebutton.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkcellrendererside…
==============================================================================
--- trunk/gtk/src/pkg/ygtkcellrenderersidebutton.c (original)
+++ trunk/gtk/src/pkg/ygtkcellrenderersidebutton.c Sat Jul 23 07:43:30 2011
@@ -20,7 +20,7 @@
G_DEFINE_TYPE (YGtkCellRendererSideButton, ygtk_cell_renderer_side_button, GTK_TYPE_CELL_RENDERER_TEXT)
static void ygtk_cell_renderer_side_button_init (YGtkCellRendererSideButton *bcell)
-{ GTK_CELL_RENDERER (bcell)->mode = GTK_CELL_RENDERER_MODE_ACTIVATABLE; }
+{ g_object_set(GTK_CELL_RENDERER(bcell), "mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE, NULL); }
static void free_pixbuf (YGtkCellRendererSideButton *cell)
{
@@ -93,7 +93,7 @@
}
static void ygtk_cell_renderer_side_button_get_size (
- GtkCellRenderer *cell, GtkWidget *widget, GdkRectangle *cell_area,
+ GtkCellRenderer *cell, GtkWidget *widget, const GdkRectangle *cell_area,
gint *x_offset, gint *y_offset, gint *width, gint *height)
{
GTK_CELL_RENDERER_CLASS (ygtk_cell_renderer_side_button_parent_class)->get_size (
@@ -107,9 +107,9 @@
}
static void ygtk_cell_renderer_side_button_render (
- GtkCellRenderer *cell, GdkDrawable *window, GtkWidget *widget,
- GdkRectangle *background_area, GdkRectangle *cell_area,
- GdkRectangle *expose_area, GtkCellRendererState flags)
+ GtkCellRenderer *cell, cairo_t *cr, GtkWidget *widget,
+ const GdkRectangle *background_area, const GdkRectangle *cell_area,
+ GtkCellRendererState flags)
{
YGtkCellRendererSideButton *bcell = YGTK_CELL_RENDERER_SIDE_BUTTON (cell);
GdkRectangle text_area = *cell_area;
@@ -120,20 +120,25 @@
text_area.x += icon_width + 8;
text_area.width -= icon_width + 8 + 4;
}
+
GTK_CELL_RENDERER_CLASS (ygtk_cell_renderer_side_button_parent_class)->render (
- cell, window, widget, background_area, &text_area, expose_area, flags);
+ cell, cr, widget, background_area, &text_area, flags);
if (bcell->button_visible) {
GtkStateType state = GTK_STATE_NORMAL;
- GtkShadowType shadow = GTK_SHADOW_OUT;
- if (!cell->sensitive || GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE)
+ gboolean sensitive = TRUE;
+ g_object_get(cell, "sensitive", &sensitive, NULL);
+ if (!sensitive || gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE)
state = GTK_STATE_INSENSITIVE;
/* else if ((flags & GTK_CELL_RENDERER_PRELIT))
state = GTK_STATE_PRELIGHT;*/
- if (bcell->active) {
- shadow = GTK_SHADOW_IN;
+ if (bcell->active)
state = GTK_STATE_ACTIVE;
- }
+
+ GtkStyleContext *style = gtk_widget_get_style_context(widget);
+ gtk_style_context_save(style);
+ gtk_style_context_set_state(style, state);
+ gtk_style_context_add_class (style, GTK_STYLE_CLASS_BUTTON);
GdkRectangle button_area = *cell_area;
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
@@ -143,29 +148,30 @@
button_area.width = icon_width + 4;
button_area.height = icon_height + 4;
button_area.y = cell_area->y + ((cell_area->height - button_area.height) / 2);
- gtk_paint_box (widget->style, window, state, shadow, expose_area, widget,
- "button", button_area.x, button_area.y, button_area.width, button_area.height);
+
+ gtk_render_background (style, cr, button_area.x, button_area.y, button_area.width, button_area.height);
+ gtk_render_frame (style, cr, button_area.x, button_area.y, button_area.width, button_area.height);
GdkRectangle icon_area = button_area;
icon_area.x += 2;
icon_area.y += 2;
if (bcell->active) {
- cell_area->x += 2;
- cell_area->y += 2;
+ icon_area.x += 2;
+ icon_area.y += 2;
}
ensure_pixbuf (bcell, widget);
- cairo_t *cr = gdk_cairo_create (window);
gdk_cairo_set_source_pixbuf (cr, bcell->pixbuf, icon_area.x, icon_area.y);
cairo_rectangle (cr, icon_area.x, icon_area.y, icon_width, icon_height);
cairo_fill (cr);
- cairo_destroy (cr);
+
+ gtk_style_context_restore(style);
}
}
static gboolean ygtk_cell_renderer_side_button_activate (
GtkCellRenderer *cell, GdkEvent *event, GtkWidget *widget, const gchar *path,
- GdkRectangle *background_area, GdkRectangle *cell_area, GtkCellRendererState flags)
+ const GdkRectangle *background_area, const GdkRectangle *cell_area, GtkCellRendererState flags)
{
YGtkCellRendererSideButton *bcell = YGTK_CELL_RENDERER_SIDE_BUTTON (cell);
if (bcell->button_visible) {
Modified: trunk/gtk/src/pkg/ygtkcellrenderersidebutton.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkcellrendererside…
==============================================================================
--- trunk/gtk/src/pkg/ygtkcellrenderersidebutton.h (original)
+++ trunk/gtk/src/pkg/ygtkcellrenderersidebutton.h Sat Jul 23 07:43:30 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_CELL_RENDERER_SIDE_BUTTON_H
#define YGTK_CELL_RENDERER_SIDE_BUTTON_H
-#include <gtk/gtkcellrenderertext.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
#define YGTK_TYPE_CELL_RENDERER_SIDE_BUTTON (ygtk_cell_renderer_side_button_get_type())
Modified: trunk/gtk/src/pkg/ygtkcellrenderertext.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkcellrenderertext…
==============================================================================
--- trunk/gtk/src/pkg/ygtkcellrenderertext.c (original)
+++ trunk/gtk/src/pkg/ygtkcellrenderertext.c Sat Jul 23 07:43:30 2011
@@ -21,27 +21,32 @@
}
static void ygtk_cell_renderer_text_render (
- GtkCellRenderer *cell, GdkDrawable *window, GtkWidget *widget,
- GdkRectangle *background_area, GdkRectangle *cell_area,
- GdkRectangle *expose_area, GtkCellRendererState flags)
+ GtkCellRenderer *cell, cairo_t *cr, GtkWidget *widget,
+ const GdkRectangle *background_area, const GdkRectangle *cell_area,
+ GtkCellRendererState flags)
{
+ // hack: disable our color attributes when the text is selected,
+ // so that the text is visible against the blue background
GtkCellRendererText *tcell = GTK_CELL_RENDERER_TEXT (cell);
PangoAttrList *old_extra_attrs = 0, *new_extra_attrs = 0;
if (flags & (GTK_CELL_RENDERER_SELECTED | GTK_CELL_RENDERER_INSENSITIVE)) {
- old_extra_attrs = pango_attr_list_copy (tcell->extra_attrs);
- new_extra_attrs = tcell->extra_attrs;
+ g_object_get(tcell, "attributes", &old_extra_attrs, NULL);
+ g_object_get(tcell, "attributes", &new_extra_attrs, NULL);
- PangoAttrList *t = pango_attr_list_filter (tcell->extra_attrs,
+ PangoAttrList *t = pango_attr_list_filter (new_extra_attrs,
filter_color_cb, NULL);
+
+ g_object_set(tcell, "attributes", new_extra_attrs, NULL);
+ pango_attr_list_unref (new_extra_attrs);
pango_attr_list_unref (t);
}
GTK_CELL_RENDERER_CLASS (ygtk_cell_renderer_text_parent_class)->render (
- cell, window, widget, background_area, cell_area, expose_area, flags);
+ cell, cr, widget, background_area, cell_area, flags);
if (old_extra_attrs) {
- tcell->extra_attrs = old_extra_attrs;
- pango_attr_list_unref (new_extra_attrs);
+ g_object_set(tcell, "attributes", old_extra_attrs, NULL);
+ pango_attr_list_unref (old_extra_attrs);
}
}
Modified: trunk/gtk/src/pkg/ygtkcellrenderertext.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkcellrenderertext…
==============================================================================
--- trunk/gtk/src/pkg/ygtkcellrenderertext.h (original)
+++ trunk/gtk/src/pkg/ygtkcellrenderertext.h Sat Jul 23 07:43:30 2011
@@ -9,7 +9,7 @@
#ifndef YGTK_CELL_RENDERER_TEXT_H
#define YGTK_CELL_RENDERER_TEXT_H
-#include <gtk/gtkcellrenderertext.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
#define YGTK_TYPE_CELL_RENDERER_TEXT (ygtk_cell_renderer_text_get_type())
Modified: trunk/gtk/src/pkg/ygtkpkgdetailview.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgdetailview.cc…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgdetailview.cc (original)
+++ trunk/gtk/src/pkg/ygtkpkgdetailview.cc Sat Jul 23 07:43:30 2011
@@ -209,7 +209,7 @@
G_CALLBACK (copy_link_cb), pThis);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
}
- gtk_menu_popup (GTK_MENU (pThis->popup), NULL, NULL, NULL, NULL,
+ gtk_menu_popup (GTK_MENU (pThis->popup), NULL, NULL, NULL, NULL,
0, gtk_get_current_event_time());
pThis->link_str = link;
}
@@ -394,7 +394,7 @@
GtkWidget *widget = hbox;
if ((versions.size() % 2) == 1)
- g_signal_connect (G_OBJECT (widget), "expose-event",
+ g_signal_connect (G_OBJECT (widget), "draw",
G_CALLBACK (draw_gray_cb), NULL);
versions.push_back (version);
gtk_box_pack_start (GTK_BOX (versions_box), widget, FALSE, TRUE, 0);
@@ -615,17 +615,15 @@
g_list_free (children);
}
- static gboolean draw_gray_cb (GtkWidget *widget, GdkEventExpose *event)
+ static gboolean draw_gray_cb (GtkWidget *widget, cairo_t *cr)
{
- GtkAllocation *alloc = &widget->allocation;
- int x = alloc->x, y = alloc->y, w = alloc->width, h = alloc->height;
+ int w = gtk_widget_get_allocated_width(widget);
+ int h = gtk_widget_get_allocated_height(widget);
- cairo_t *cr = gdk_cairo_create (widget->window);
- cairo_rectangle (cr, x, y, w, h);
+ cairo_rectangle (cr, 0, 0, w, h);
// use alpha to cope with styles who might not have a white background
cairo_set_source_rgba (cr, 0, 0, 0, .060);
cairo_fill (cr);
- cairo_destroy (cr);
return FALSE;
}
};
@@ -771,7 +769,7 @@
static const char *getLabel (int dep)
{
-
+
switch ((zypp::Dep::for_use_in_switch) dep) {
case zypp::Dep::PROVIDES_e: return "Provides:";
case zypp::Dep::PREREQUIRES_e: return "Pre-requires:";
@@ -1198,7 +1196,7 @@
GtkWidget *child = gtk_event_box_new();
gtk_container_add (GTK_CONTAINER (child), hbox);
- GdkColor *color = &detail_description->style->base [GTK_STATE_NORMAL];
+ GdkColor *color = >k_widget_get_style(detail_description)->base [GTK_STATE_NORMAL];
gtk_widget_modify_bg (child, GTK_STATE_NORMAL, color);
m_scroll = gtk_scrolled_window_new (NULL, NULL);
@@ -1253,7 +1251,10 @@
{
GtkScrolledWindow *_scroll = GTK_SCROLLED_WINDOW (scroll);
GtkAdjustment *adj = gtk_scrolled_window_get_vadjustment (_scroll);
- int height = scroll->allocation.height;
+ GtkAllocation alloc;
+ gtk_widget_get_allocation(scroll, &alloc);
+
+ int height = alloc.height;
gdouble increment;
switch (step) {
case GTK_MOVEMENT_DISPLAY_LINES:
@@ -1263,17 +1264,17 @@
increment = height * 0.9;
break;
case GTK_MOVEMENT_DISPLAY_LINE_ENDS:
- increment = adj->upper - adj->lower;
+ increment = gtk_adjustment_get_upper(adj) - gtk_adjustment_get_lower(adj);
break;
default:
increment = 0.0;
break;
}
- gdouble value = adj->value + (count * increment);
- value = MIN (value, adj->upper - adj->page_size);
- value = MAX (value, adj->lower);
- if (value != adj->value)
+ gdouble value = gtk_adjustment_get_value(adj) + (count * increment);
+ value = MIN (value, gtk_adjustment_get_upper(adj) - gtk_adjustment_get_page_size(adj));
+ value = MAX (value, gtk_adjustment_get_lower(adj));
+ if (value != gtk_adjustment_get_value(adj))
gtk_adjustment_set_value (adj, value);
}
Modified: trunk/gtk/src/pkg/ygtkpkgdetailview.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgdetailview.h?…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgdetailview.h (original)
+++ trunk/gtk/src/pkg/ygtkpkgdetailview.h Sat Jul 23 07:43:30 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_PKG_DETAIL_VIEW_H
#define YGTK_PKG_DETAIL_VIEW_H
-#include <gtk/gtkwidget.h>
+#include <gtk/gtk.h>
#include "yzyppwrapper.h"
struct YGtkPkgDetailView
Modified: trunk/gtk/src/pkg/ygtkpkgfilterview.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgfilterview.h?…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgfilterview.h (original)
+++ trunk/gtk/src/pkg/ygtkpkgfilterview.h Sat Jul 23 07:43:30 2011
@@ -16,7 +16,7 @@
#define YGTK_PKG_FILTER_VIEW_H
#include "ygtkpkgquerywidget.h"
-#include <gtk/gtktreestore.h>
+#include <gtk/gtk.h>
struct YGtkPkgFilterModel // abstract
{
Modified: trunk/gtk/src/pkg/ygtkpkghistorydialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkghistorydialog…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkghistorydialog.cc (original)
+++ trunk/gtk/src/pkg/ygtkpkghistorydialog.cc Sat Jul 23 07:43:30 2011
@@ -504,7 +504,7 @@
gtk_tree_view_get_model (date_view), &iter))
gtk_tree_selection_select_iter (selection, &iter);
- gdk_window_set_cursor (dialog->window, NULL);
+ gdk_window_set_cursor (gtk_widget_get_window(GTK_WIDGET(dialog)), NULL);
return FALSE;
}
@@ -637,7 +637,8 @@
gtk_paned_pack1 (GTK_PANED (hpaned), date_scroll, FALSE, FALSE);
gtk_paned_pack2 (GTK_PANED (hpaned), log_scroll, TRUE, FALSE);
YGUtils::setPaneRelPosition (hpaned, .30);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hpaned);
+ gtk_widget_set_vexpand (hpaned, TRUE);
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area(GTK_DIALOG (dialog))), hpaned);
gtk_widget_show_all (dialog);
m_dialog = dialog;
@@ -654,7 +655,7 @@
G_CALLBACK (date_selection_changed_cb), log_view);
GdkCursor *cursor = gdk_cursor_new (GDK_WATCH);
- gdk_window_set_cursor (dialog->window, cursor);
+ gdk_window_set_cursor (gtk_widget_get_window(GTK_WIDGET(dialog)), cursor);
gdk_cursor_unref (cursor);
GtkWidget **views = g_new (GtkWidget *, 3);
Modified: trunk/gtk/src/pkg/ygtkpkghistorydialog.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkghistorydialog…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkghistorydialog.h (original)
+++ trunk/gtk/src/pkg/ygtkpkghistorydialog.h Sat Jul 23 07:43:30 2011
@@ -9,7 +9,7 @@
#ifndef YGTK_PKG_HISTORY_DIALOG_H
#define YGTK_PKG_HISTORY_DIALOG_H
-#include <gtk/gtkwidget.h>
+#include <gtk/gtk.h>
struct YGtkPkgHistoryDialog
{
Modified: trunk/gtk/src/pkg/ygtkpkglistview.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkglistview.cc?r…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkglistview.cc (original)
+++ trunk/gtk/src/pkg/ygtkpkglistview.cc Sat Jul 23 07:43:30 2011
@@ -515,7 +515,7 @@
static void selection_changed_cb (GtkTreeSelection *selection, YGtkPkgListView *pThis)
{
- if (GTK_WIDGET_REALIZED (pThis->impl->view) && pThis->impl->listener)
+ if (gtk_widget_get_realized (pThis->impl->view) && pThis->impl->listener)
pThis->impl->listener->selectionChanged();
}
@@ -742,7 +742,7 @@
gtk_tree_selection_select_path (selection, path);
gtk_tree_path_free (path);
}
- else if (GTK_WIDGET_REALIZED (impl->view))
+ else if (gtk_widget_get_realized (impl->view))
gtk_tree_view_scroll_to_point (GTK_TREE_VIEW (impl->view), -1, 0);
}
Modified: trunk/gtk/src/pkg/ygtkpkglistview.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkglistview.h?re…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkglistview.h (original)
+++ trunk/gtk/src/pkg/ygtkpkglistview.h Sat Jul 23 07:43:30 2011
@@ -9,7 +9,7 @@
#define YGTK_PKG_LIST_VIEW_H
#include "yzyppwrapper.h"
-#include <gtk/gtkwidget.h>
+#include <gtk/gtk.h>
enum Property {
INSTALLED_CHECK_PROP, NAME_PROP, ACTION_NAME_PROP, NAME_SUMMARY_PROP,
Modified: trunk/gtk/src/pkg/ygtkpkgmenubar.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgmenubar.cc?re…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgmenubar.cc (original)
+++ trunk/gtk/src/pkg/ygtkpkgmenubar.cc Sat Jul 23 07:43:30 2011
@@ -450,7 +450,8 @@
struct CheckMenuFlag {
CheckMenuFlag (GtkWidget *menu, const char *text) {
- m_item = gtk_check_menu_item_new_with_mnemonic (text);
+ std::string str (YGUtils::mapKBAccel(text));
+ m_item = gtk_check_menu_item_new_with_mnemonic (str.c_str());
g_object_set_data_full (G_OBJECT (m_item), "this", this, destructor);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), m_item);
}
Modified: trunk/gtk/src/pkg/ygtkpkgmenubar.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgmenubar.h?rev…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgmenubar.h (original)
+++ trunk/gtk/src/pkg/ygtkpkgmenubar.h Sat Jul 23 07:43:30 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_PKG_MENU_BAR_H
#define YGTK_PKG_MENU_BAR_H
-#include <gtk/gtkwidget.h>
+#include <gtk/gtk.h>
struct YGtkPkgMenuBar
{
Modified: trunk/gtk/src/pkg/ygtkpkgpatternview.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgpatternview.h…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgpatternview.h (original)
+++ trunk/gtk/src/pkg/ygtkpkgpatternview.h Sat Jul 23 07:43:30 2011
@@ -9,7 +9,7 @@
#define YGTK_PKG_PATTERN_LIST_H
#include "ygtkpkgquerywidget.h"
-#include <gtk/gtkwidget.h>
+#include <gtk/gtk.h>
struct YGtkPkgPatternView : public YGtkPkgQueryWidget
{
Modified: trunk/gtk/src/pkg/ygtkpkgproductdialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgproductdialog…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgproductdialog.cc (original)
+++ trunk/gtk/src/pkg/ygtkpkgproductdialog.cc Sat Jul 23 07:43:30 2011
@@ -98,7 +98,7 @@
sel->candidateObj().isSatisfied() || sel->hasInstalledObj(),
TEXT_COLUMN, text.c_str(), VERSION_COLUMN, version.c_str(),
VENDOR_COLUMN, prod->vendor().c_str(), DESCRIPTION_COLUMN,
- description.c_str(), -1);
+ description.c_str(), -1);
}
GtkWidget *description = ygtk_rich_text_new();
@@ -121,7 +121,7 @@
renderer = gtk_cell_renderer_toggle_new();
column = gtk_tree_view_column_new_with_attributes (
NULL, renderer, "active", INSTALLED_COLUMN, NULL);
- g_object_set (G_OBJECT (renderer), "sensitive", FALSE, NULL);
+ gtk_cell_renderer_set_sensitive(renderer, FALSE);
gtk_tree_view_append_column (tview, column);
renderer = gtk_cell_renderer_text_new();
@@ -167,7 +167,8 @@
gtk_paned_pack1 (GTK_PANED (vpaned), scroll, TRUE, FALSE);
gtk_paned_pack2 (GTK_PANED (vpaned), description_scroll, FALSE, TRUE);
YGUtils::setPaneRelPosition (vpaned, .70);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), vpaned);
+ gtk_widget_set_vexpand (vpaned, TRUE);
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area(GTK_DIALOG (dialog))), vpaned);
gtk_widget_show_all (dialog);
m_dialog = dialog;
Modified: trunk/gtk/src/pkg/ygtkpkgproductdialog.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgproductdialog…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgproductdialog.h (original)
+++ trunk/gtk/src/pkg/ygtkpkgproductdialog.h Sat Jul 23 07:43:30 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_PKG_PRODUCT_DIALOG_H
#define YGTK_PKG_PRODUCT_DIALOG_H
-#include <gtk/gtkwidget.h>
+#include <gtk/gtk.h>
struct YGtkPkgProductDialog
{
Modified: trunk/gtk/src/pkg/ygtkpkgquerycombo.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgquerycombo.cc…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgquerycombo.cc (original)
+++ trunk/gtk/src/pkg/ygtkpkgquerycombo.cc Sat Jul 23 07:43:30 2011
@@ -51,7 +51,7 @@
YGtkPkgQueryCombo::YGtkPkgQueryCombo (Factory *factory)
: impl (new Impl (factory))
{
- impl->combo = gtk_combo_box_new_text();
+ impl->combo = gtk_combo_box_text_new();
gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (impl->combo),
YGUtils::empty_row_is_separator_cb, GINT_TO_POINTER (0), NULL);
g_signal_connect_after (G_OBJECT (impl->combo), "changed",
@@ -70,8 +70,8 @@
void YGtkPkgQueryCombo::add (const char *title)
{
- GtkComboBox *combo = GTK_COMBO_BOX (impl->combo);
- gtk_combo_box_append_text (combo, title);
+ GtkComboBoxText *combo = GTK_COMBO_BOX_TEXT (impl->combo);
+ gtk_combo_box_text_append (combo, NULL, title);
}
void YGtkPkgQueryCombo::setActive (int index)
Modified: trunk/gtk/src/pkg/ygtkpkgquerycombo.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgquerycombo.h?…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgquerycombo.h (original)
+++ trunk/gtk/src/pkg/ygtkpkgquerycombo.h Sat Jul 23 07:43:30 2011
@@ -10,7 +10,7 @@
#define YGTK_PKG_QUERY_COMBO_H
#include "ygtkpkgquerywidget.h"
-#include <gtk/gtkwidget.h>
+#include <gtk/gtk.h>
struct YGtkPkgQueryCombo : public YGtkPkgQueryWidget
{
Modified: trunk/gtk/src/pkg/ygtkpkgquerywidget.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgquerywidget.h…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgquerywidget.h (original)
+++ trunk/gtk/src/pkg/ygtkpkgquerywidget.h Sat Jul 23 07:43:30 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_PKG_QUERY_WIDGET_H
#define YGTK_PKG_QUERY_WIDGET_H
-#include <gtk/gtkwidget.h>
+#include <gtk/gtk.h>
#include "yzyppwrapper.h"
struct YGtkPkgQueryWidget
Modified: trunk/gtk/src/pkg/ygtkpkgrpmgroupsview.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgrpmgroupsview…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgrpmgroupsview.h (original)
+++ trunk/gtk/src/pkg/ygtkpkgrpmgroupsview.h Sat Jul 23 07:43:30 2011
@@ -9,7 +9,7 @@
#define YGTK_PKG_RPM_GROUP_VIEW_H
#include "ygtkpkgquerywidget.h"
-#include <gtk/gtkwidget.h>
+#include <gtk/gtk.h>
struct YGtkPkgRpmGroupsView : public YGtkPkgQueryWidget
{
Modified: trunk/gtk/src/pkg/ygtkpkgsearchentry.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgsearchentry.c…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgsearchentry.cc (original)
+++ trunk/gtk/src/pkg/ygtkpkgsearchentry.cc Sat Jul 23 07:43:30 2011
@@ -98,13 +98,14 @@
GtkWidget *label = gtk_label_new_with_mnemonic (label_str.c_str());
gtk_label_set_mnemonic_widget (GTK_LABEL (label), impl->entry);
- impl->combo = gtk_combo_box_new_text();
- gtk_combo_box_append_text (GTK_COMBO_BOX (impl->combo), _("Name & Summary"));
- gtk_combo_box_append_text (GTK_COMBO_BOX (impl->combo), _("Description"));
+ impl->combo = gtk_combo_box_text_new();
+ GtkComboBoxText *combot = GTK_COMBO_BOX_TEXT (impl->combo);
+ gtk_combo_box_text_append (combot, 0, _("Name & Summary"));
+ gtk_combo_box_text_append (combot, 0, _("Description"));
if (!YGPackageSelector::get()->onlineUpdateMode()) {
- gtk_combo_box_append_text (GTK_COMBO_BOX (impl->combo), _("File name"));
- gtk_combo_box_append_text (GTK_COMBO_BOX (impl->combo), "RPM Provides");
- gtk_combo_box_append_text (GTK_COMBO_BOX (impl->combo), "RPM Requires");
+ gtk_combo_box_text_append (combot, 0, _("File name"));
+ gtk_combo_box_text_append (combot, 0, "RPM Provides");
+ gtk_combo_box_text_append (combot, 0, "RPM Requires");
}
gtk_combo_box_set_active (GTK_COMBO_BOX (impl->combo), 0);
YGUtils::shrinkWidget (impl->combo);
Modified: trunk/gtk/src/pkg/ygtkpkgstatusbar.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgstatusbar.cc?…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgstatusbar.cc (original)
+++ trunk/gtk/src/pkg/ygtkpkgstatusbar.cc Sat Jul 23 07:43:30 2011
@@ -19,9 +19,6 @@
#include "yzyppwrapper.h"
#include <gtk/gtk.h>
-static void enlarge_width_size_request_cb (GtkWidget *widget, GtkRequisition *req)
-{ req->width += 4; }
-
struct LastChange {
GtkWidget *hbox, *icon, *text, *undo_button;
@@ -36,8 +33,6 @@
gtk_misc_set_alignment (GTK_MISC (text), 0, .5);
undo_button = gtk_button_new_from_stock (GTK_STOCK_UNDO);
YGUtils::shrinkWidget (undo_button);
- g_signal_connect (G_OBJECT (undo_button), "size-request",
- G_CALLBACK (enlarge_width_size_request_cb), NULL);
g_signal_connect (G_OBJECT (undo_button), "clicked",
G_CALLBACK (undo_clicked_cb), this);
gchar *str = g_strdup_printf ("(<a href=\"more\">%s</a>)", _("view all changes"));
@@ -117,13 +112,16 @@
void set_ellipsize (GtkWidget *label)
{
GtkWidget *hbox = gtk_widget_get_parent (this->hbox);
- if (GTK_WIDGET_REALIZED (hbox)) {
+ if (gtk_widget_get_realized (hbox)) {
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_NONE);
GtkRequisition req;
gtk_widget_size_request (hbox, &req);
GtkWidget *window = gtk_widget_get_toplevel (hbox);
- bool ellipsize = req.width > window->allocation.width - 10;
+ GtkAllocation allocation;
+ gtk_widget_get_allocation(window, &allocation);
+
+ bool ellipsize = req.width > allocation.width - 10;
PangoEllipsizeMode mode = ellipsize ? PANGO_ELLIPSIZE_MIDDLE : PANGO_ELLIPSIZE_NONE;
gtk_label_set_ellipsize (GTK_LABEL (label), mode);
Modified: trunk/gtk/src/pkg/ygtkpkgstatusbar.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgstatusbar.h?r…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgstatusbar.h (original)
+++ trunk/gtk/src/pkg/ygtkpkgstatusbar.h Sat Jul 23 07:43:30 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_PKG_STATUS_BAR_H
#define YGTK_PKG_STATUS_BAR_H
-#include <gtk/gtkwidget.h>
+#include <gtk/gtk.h>
struct YGtkPkgUndoList;
Modified: trunk/gtk/src/pkg/ygtkpkgundolist.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgundolist.cc?r…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgundolist.cc (original)
+++ trunk/gtk/src/pkg/ygtkpkgundolist.cc Sat Jul 23 07:43:30 2011
@@ -307,7 +307,8 @@
if (onApply)
gtk_box_pack_start (GTK_BOX (vbox), create_close_when_done_check(), FALSE, TRUE, 0);
gtk_widget_show (vbox);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), vbox);
+ gtk_widget_set_vexpand (vbox, TRUE);
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area(GTK_DIALOG (dialog))), vbox);
int ret = gtk_dialog_run (GTK_DIALOG (dialog));
if (ret == 1)
Modified: trunk/gtk/src/pkg/ygtkpkgvestigialdialog.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgvestigialdial…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgvestigialdialog.h (original)
+++ trunk/gtk/src/pkg/ygtkpkgvestigialdialog.h Sat Jul 23 07:43:30 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_PKG_VESTIGIAL_DIALOG_H
#define YGTK_PKG_VESTIGIAL_DIALOG_H
-#include <gtk/gtkwidget.h>
+#include <gtk/gtk.h>
struct YGtkPkgVestigialDialog
{
Modified: trunk/gtk/src/pkg/ygtktreemodel.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtktreemodel.h?rev=…
==============================================================================
--- trunk/gtk/src/pkg/ygtktreemodel.h (original)
+++ trunk/gtk/src/pkg/ygtktreemodel.h Sat Jul 23 07:43:30 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_TREE_MODEL_H
#define YGTK_TREE_MODEL_H
-#include <gtk/gtktreemodel.h>
+#include <gtk/gtk.h>
struct YGtkTreeModel
{
Modified: trunk/gtk/src/ygdkmngloader.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygdkmngloader.c?rev=6496…
==============================================================================
--- trunk/gtk/src/ygdkmngloader.c (original)
+++ trunk/gtk/src/ygdkmngloader.c Sat Jul 23 07:43:30 2011
@@ -132,8 +132,7 @@
{
gboolean error = FALSE;
FILE *file = fopen (filename, "rb");
- if (!file)
- {
+ if (!file) {
SET_ERROR ("Could not open specified file")
return NULL;
}
@@ -147,8 +146,7 @@
fileno (file), 0);
if (data == MAP_FAILED)
SET_ERROR ("Could not map file")
- else
- {
+ else {
mng_pixbuf = ygdk_mng_pixbuf_new_from_data (data, file_size, error_msg);
munmap (data, file_size);
}
@@ -162,8 +160,7 @@
DataStream data = data_stream_constructor (raw_data, size);
gboolean error = FALSE;
- if (!read_signature (&data))
- {
+ if (!read_signature (&data)) {
SET_ERROR ("Not a MNG file")
return NULL;
}
@@ -179,8 +176,7 @@
do {
error = !read_uint32 (&data, &chunk_size);
error = error || !read_uint32 (&data, &chunk_id);
- if (error)
- {
+ if (error) {
SET_ERROR ("Unexpected end of file on new chunk")
break;
}
Modified: trunk/gtk/src/ygtkbargraph.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkbargraph.c?rev=64969…
==============================================================================
--- trunk/gtk/src/ygtkbargraph.c (original)
+++ trunk/gtk/src/ygtkbargraph.c Sat Jul 23 07:43:30 2011
@@ -20,10 +20,21 @@
ygtk_bar_graph_set_style (bar, TRUE);
}
-static void ygtk_bar_graph_size_request (GtkWidget *widget, GtkRequisition *requisition)
+static void
+ygtk_bar_graph_get_preferred_height (GtkWidget *widget,
+ gint *minimal_height,
+ gint *natural_height)
{
- GTK_WIDGET_CLASS (ygtk_bar_graph_parent_class)->size_request (widget, requisition);
- requisition->height += 18; // give room for the labels
+ GTK_WIDGET_CLASS (ygtk_bar_graph_parent_class)->get_preferred_height (widget, minimal_height, natural_height);
+ *natural_height = *minimal_height = *minimal_height + 18; // give room for the labels
+}
+
+static void
+ygtk_bar_graph_get_preferred_width (GtkWidget *widget,
+ gint *minimal_width,
+ gint *natural_width)
+{
+ GTK_WIDGET_CLASS (ygtk_bar_graph_parent_class)->get_preferred_width (widget, minimal_width, natural_width);
}
GtkWidget *ygtk_bar_graph_new (void)
@@ -33,7 +44,7 @@
void ygtk_bar_graph_create_entries (YGtkBarGraph *bar, guint entries)
{
- YGtkRatioBox *box = YGTK_RATIO_BOX (GTK_BIN (bar)->child);
+ YGtkRatioBox *box = YGTK_RATIO_BOX (gtk_bin_get_child(GTK_BIN (bar)));
// Remove the ones in excess
guint i;
@@ -56,7 +67,7 @@
static GtkWidget *ygtk_bar_graph_get_label (YGtkBarGraph *bar, int index, GtkWidget **b)
{
- YGtkRatioBox *hbox = YGTK_RATIO_BOX (GTK_BIN (bar)->child);
+ YGtkRatioBox *hbox = YGTK_RATIO_BOX (gtk_bin_get_child(GTK_BIN (bar)));
GtkWidget *box = ((YGtkRatioBoxChild *) g_list_nth_data (hbox->children, index))->widget;
if (b) *b = box;
return gtk_bin_get_child (GTK_BIN (box));
@@ -92,7 +103,7 @@
// Set proportion
gtk_widget_set_size_request (box, 0, -1);
- YGtkRatioBox *hbox = YGTK_RATIO_BOX (GTK_BIN (bar)->child);
+ YGtkRatioBox *hbox = YGTK_RATIO_BOX (gtk_bin_get_child(GTK_BIN (bar)));
ygtk_ratio_box_set_child_packing (hbox, box, MAX (value, 1));
// Set background color
@@ -129,7 +140,7 @@
YGtkColoredLabel *color_label = YGTK_COLORED_LABEL (label);
const guint *color = palette [index % G_N_ELEMENTS (palette)];
- GdkColor gcolor = { 0, color[0] << 8, color[1] << 8, color[2] << 8 };
+ GdkRGBA gcolor = { color[0] / 255., color[1] / 255., color[2] / 255., 0 };
ygtk_colored_label_set_background (color_label, &gcolor);
}
@@ -140,13 +151,13 @@
gtk_frame_set_shadow_type (GTK_FRAME (bar), shadow);
}
-void ygtk_bar_graph_customize_bg (YGtkBarGraph *bar, int index, GdkColor *color)
+void ygtk_bar_graph_customize_bg (YGtkBarGraph *bar, int index, GdkRGBA *color)
{
GtkWidget *label = ygtk_bar_graph_get_label (bar, index, NULL);
ygtk_colored_label_set_background (YGTK_COLORED_LABEL (label), color);
}
-void ygtk_bar_graph_customize_fg (YGtkBarGraph *bar, int index, GdkColor *color)
+void ygtk_bar_graph_customize_fg (YGtkBarGraph *bar, int index, GdkRGBA *color)
{
GtkWidget *label = ygtk_bar_graph_get_label (bar, index, NULL);
ygtk_colored_label_set_foreground (YGTK_COLORED_LABEL (label), color);
@@ -157,7 +168,8 @@
ygtk_bar_graph_parent_class = g_type_class_peek_parent (klass);
GtkWidgetClass* widget_class = GTK_WIDGET_CLASS (klass);
- widget_class->size_request = ygtk_bar_graph_size_request;
+ widget_class->get_preferred_width = ygtk_bar_graph_get_preferred_width;
+ widget_class->get_preferred_height = ygtk_bar_graph_get_preferred_height;
}
//** YGtkColoredLabel
@@ -172,55 +184,49 @@
static inline double pixel_clamp (double val)
{ return MAX (0, MIN (1, val)); }
-static gboolean ygtk_colored_label_expose_event (GtkWidget *widget, GdkEventExpose *event)
+static gboolean ygtk_colored_label_on_draw (GtkWidget *widget, cairo_t *cr)
{
- GtkAllocation *alloc = &widget->allocation;
+ GtkStyleContext *ctx;
+ ctx = gtk_widget_get_style_context(widget);
+
+ GdkRGBA color;
+ gtk_style_context_get_background_color(ctx, GTK_STATE_NORMAL, &color);
+
+ cairo_save(cr);
+ int width = gtk_widget_get_allocated_width (widget);
+ int height = gtk_widget_get_allocated_height (widget);
+ cairo_scale (cr, width, height);
- GdkColor *bg_color = &widget->style->bg[GTK_STATE_NORMAL];
- double red = (bg_color->red >> 8) / 255.;
- double green = (bg_color->green >> 8) / 255.;
- double blue = (bg_color->blue >> 8) / 255.;
-
- cairo_t *cr = gdk_cairo_create (event->window);
- cairo_translate (cr, alloc->x, alloc->y);
- cairo_scale (cr, alloc->width, alloc->height);
-
- double x, y, w, h;
- x = alloc->x;
- y = alloc->y;
- w = alloc->width;
- h = alloc->height;
cairo_pattern_t *grad = cairo_pattern_create_linear (0, 0, 0, 1);
- cairo_pattern_add_color_stop_rgba (grad, 0, pixel_clamp (red+.3), pixel_clamp (green+.3), pixel_clamp (blue+.3), 1);
- cairo_pattern_add_color_stop_rgba (grad, 0.70, red, green, blue, 1);
- cairo_pattern_add_color_stop_rgba (grad, 1, pixel_clamp (red-.2), pixel_clamp (green-.2), pixel_clamp (blue-.2), 1);
+ cairo_pattern_add_color_stop_rgba (grad, 0, pixel_clamp (color.red+.3), pixel_clamp (color.green+.3), pixel_clamp (color.blue+.3), 1);
+ cairo_pattern_add_color_stop_rgba (grad, 0.70, color.red, color.green, color.blue, 1);
+ cairo_pattern_add_color_stop_rgba (grad, 1, pixel_clamp (color.red-.2), pixel_clamp (color.green-.2), pixel_clamp (color.blue-.2), 1);
cairo_rectangle (cr, 0, 0, 1, 1);
cairo_set_source (cr, grad);
cairo_fill (cr);
cairo_pattern_destroy (grad);
- cairo_destroy (cr);
-
- GTK_WIDGET_CLASS (ygtk_colored_label_parent_class)->expose_event (widget, event);
+ cairo_restore(cr);
+ GTK_WIDGET_CLASS (ygtk_colored_label_parent_class)->draw (widget, cr);
return FALSE;
}
GtkWidget *ygtk_colored_label_new (void)
{ return g_object_new (YGTK_TYPE_COLORED_LABEL, NULL); }
-void ygtk_colored_label_set_background (YGtkColoredLabel *label, GdkColor *color)
-{ gtk_widget_modify_bg (GTK_WIDGET (label), GTK_STATE_NORMAL, color); }
+void ygtk_colored_label_set_background (YGtkColoredLabel *label, GdkRGBA *color)
+{ gtk_widget_override_background_color (GTK_WIDGET (label), GTK_STATE_NORMAL, color); }
-void ygtk_colored_label_set_foreground (YGtkColoredLabel *label, GdkColor *color)
-{ gtk_widget_modify_fg (GTK_WIDGET (label), GTK_STATE_NORMAL, color); }
+void ygtk_colored_label_set_foreground (YGtkColoredLabel *label, GdkRGBA *color)
+{ gtk_widget_override_color (GTK_WIDGET (label), GTK_STATE_NORMAL, color); }
static void ygtk_colored_label_class_init (YGtkColoredLabelClass *klass)
{
ygtk_colored_label_parent_class = g_type_class_peek_parent (klass);
GtkWidgetClass* widget_class = GTK_WIDGET_CLASS (klass);
- widget_class->expose_event = ygtk_colored_label_expose_event;
+ widget_class->draw = ygtk_colored_label_on_draw;
}
Modified: trunk/gtk/src/ygtkbargraph.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkbargraph.h?rev=64969…
==============================================================================
--- trunk/gtk/src/ygtkbargraph.h (original)
+++ trunk/gtk/src/ygtkbargraph.h Sat Jul 23 07:43:30 2011
@@ -9,7 +9,7 @@
#ifndef YGTK_BAR_GRAPH_H
#define YGTK_BAR_GRAPH_H
-#include <gtk/gtkframe.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
#define YGTK_TYPE_BAR_GRAPH (ygtk_bar_graph_get_type ())
@@ -46,8 +46,8 @@
void ygtk_bar_graph_setup_entry (YGtkBarGraph *bar, int index, const gchar *label_entry, int value);
void ygtk_bar_graph_set_style (YGtkBarGraph *bar, gboolean flat);
-void ygtk_bar_graph_customize_bg (YGtkBarGraph *bar, int index, GdkColor *color);
-void ygtk_bar_graph_customize_fg (YGtkBarGraph *bar, int index, GdkColor *color);
+void ygtk_bar_graph_customize_bg (YGtkBarGraph *bar, int index, GdkRGBA *color);
+void ygtk_bar_graph_customize_fg (YGtkBarGraph *bar, int index, GdkRGBA *color);
G_END_DECLS
#endif /*YGTK_BAR_GRAPH_H*/
@@ -55,7 +55,6 @@
#ifndef YGTK_COLORED_LABEL_H
#define YGTK_COLORED_LABEL_H
-#include <gtk/gtklabel.h>
G_BEGIN_DECLS
/* YGtkColoredLabel is a GtkLabel where gtk_modify_bg() can be used. It also
@@ -88,8 +87,8 @@
// A convenience function (you may use gtk_widget_modify_fg() and
// gtk_widget_modify_bg() instead), where colors range is [0, 255]
-void ygtk_colored_label_set_foreground (YGtkColoredLabel *label, GdkColor *color);
-void ygtk_colored_label_set_background (YGtkColoredLabel *label, GdkColor *color);
+void ygtk_colored_label_set_foreground (YGtkColoredLabel *label, GdkRGBA *color);
+void ygtk_colored_label_set_background (YGtkColoredLabel *label, GdkRGBA *color);
G_END_DECLS
#endif /*YGTK_COLORED_LABEL*/
Modified: trunk/gtk/src/ygtkfieldentry.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkfieldentry.c?rev=649…
==============================================================================
--- trunk/gtk/src/ygtkfieldentry.c (original)
+++ trunk/gtk/src/ygtkfieldentry.c Sat Jul 23 07:43:30 2011
@@ -184,7 +184,7 @@
filter_entry_signal = g_signal_new ("field_entry_changed",
G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (YGtkFieldEntryClass, filter_entry_changed),
- NULL, NULL, gtk_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
+ NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
}
gboolean ygtk_field_entry_set_focus (YGtkFieldEntry *fields)
Modified: trunk/gtk/src/ygtkfieldentry.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkfieldentry.h?rev=649…
==============================================================================
--- trunk/gtk/src/ygtkfieldentry.h (original)
+++ trunk/gtk/src/ygtkfieldentry.h Sat Jul 23 07:43:30 2011
@@ -12,8 +12,7 @@
#ifndef YGTK_FIELD_ENTRY_H
#define YGTK_FIELD_ENTRY_H
-#include <gtk/gtkhbox.h>
-#include <gtk/gtkentry.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
#define YGTK_TYPE_FIELD_ENTRY (ygtk_field_entry_get_type ())
@@ -43,7 +42,7 @@
GtkWidget* ygtk_field_entry_new (void);
GType ygtk_field_entry_get_type (void) G_GNUC_CONST;
-// if this is the first field, separator will be ignored.
+// if this is the first field, separator will be ignored.
guint ygtk_field_entry_add_field (YGtkFieldEntry *entry, gchar separator);
// max_length can be 0 to disable it. valids_chars can be NULL to disable it.
void ygtk_field_entry_setup_field (YGtkFieldEntry *entry, guint index,
Modified: trunk/gtk/src/ygtkfixed.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkfixed.c?rev=64969&r1…
==============================================================================
--- trunk/gtk/src/ygtkfixed.c (original)
+++ trunk/gtk/src/ygtkfixed.c Sat Jul 23 07:43:30 2011
@@ -14,14 +14,15 @@
static void ygtk_fixed_init (YGtkFixed *fixed)
{
- GTK_WIDGET_SET_FLAGS (fixed, GTK_NO_WINDOW);
+ gtk_widget_set_has_window(GTK_WIDGET(fixed), FALSE);
gtk_widget_set_redraw_on_allocate (GTK_WIDGET (fixed), FALSE);
}
-void ygtk_fixed_setup (YGtkFixed *fixed, YGtkPreferredSize cb1, YGtkSetSize cb2, gpointer data)
+void ygtk_fixed_setup (YGtkFixed *fixed, YGtkPreferredWidth cb1, YGtkPreferredHeight cb2, YGtkSetSize cb3, gpointer data)
{
- fixed->preferred_size_cb = cb1;
- fixed->set_size_cb = cb2;
+ fixed->preferred_width_cb = cb1;
+ fixed->preferred_height_cb = cb2;
+ fixed->set_size_cb = cb3;
fixed->data = data;
}
@@ -68,7 +69,7 @@
for (i = fixed->children; i; i = i->next) {
YGtkFixedChild *child = i->data;
if (child->widget == widget) {
- gboolean was_visible = GTK_WIDGET_VISIBLE (widget);
+ gboolean was_visible = gtk_widget_get_visible (widget);
gtk_widget_unparent (widget);
fixed->children = g_slist_delete_link (fixed->children, i);
g_free (child);
@@ -92,12 +93,24 @@
}
}
-static void ygtk_fixed_size_request (GtkWidget *widget, GtkRequisition *requisition)
+static void
+ygtk_fixed_get_preferred_width (GtkWidget *widget,
+ gint *minimum_width,
+ gint *natural_width)
{
YGtkFixed *fixed = YGTK_FIXED (widget);
- fixed->preferred_size_cb (fixed, &requisition->width, &requisition->height,
- fixed->data);
- GTK_WIDGET_CLASS (ygtk_fixed_parent_class)->size_request (widget, requisition);
+ *natural_width = *minimum_width =
+ fixed->preferred_width_cb (fixed, fixed->data);
+}
+
+static void
+ygtk_fixed_get_preferred_height (GtkWidget *widget,
+ gint *minimum_height,
+ gint *natural_height)
+{
+ YGtkFixed *fixed = YGTK_FIXED (widget);
+ *natural_height = *minimum_height =
+ fixed->preferred_height_cb (fixed, fixed->data);
}
static void ygtk_fixed_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
@@ -134,7 +147,8 @@
container_class->child_type = ygtk_fixed_child_type;
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- widget_class->size_request = ygtk_fixed_size_request;
+ widget_class->get_preferred_width = ygtk_fixed_get_preferred_width;
+ widget_class->get_preferred_height = ygtk_fixed_get_preferred_height;
widget_class->size_allocate = ygtk_fixed_size_allocate;
}
Modified: trunk/gtk/src/ygtkfixed.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkfixed.h?rev=64969&r1…
==============================================================================
--- trunk/gtk/src/ygtkfixed.h (original)
+++ trunk/gtk/src/ygtkfixed.h Sat Jul 23 07:43:30 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_FIXED_H
#define YGTK_FIXED_H
-#include <gtk/gtkcontainer.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
#define YGTK_TYPE_FIXED (ygtk_fixed_get_type ())
@@ -26,7 +26,8 @@
typedef struct _YGtkFixed YGtkFixed;
typedef struct _YGtkFixedClass YGtkFixedClass;
-typedef void (*YGtkPreferredSize) (YGtkFixed *, gint *, gint *, gpointer);
+typedef gint (*YGtkPreferredWidth) (YGtkFixed *, gpointer);
+typedef gint (*YGtkPreferredHeight) (YGtkFixed *, gpointer);
typedef void (*YGtkSetSize) (YGtkFixed *, gint, gint, gpointer);
struct _YGtkFixed
@@ -34,7 +35,8 @@
GtkContainer parent;
// private (read-only):
GSList *children;
- YGtkPreferredSize preferred_size_cb;
+ YGtkPreferredWidth preferred_width_cb;
+ YGtkPreferredHeight preferred_height_cb;
YGtkSetSize set_size_cb;
gpointer data;
};
@@ -54,7 +56,7 @@
GType ygtk_fixed_get_type (void) G_GNUC_CONST;
-void ygtk_fixed_setup (YGtkFixed *fixed, YGtkPreferredSize cb1, YGtkSetSize cb2, gpointer data);
+void ygtk_fixed_setup (YGtkFixed *fixed, YGtkPreferredWidth cb1, YGtkPreferredHeight cb2, YGtkSetSize cb3, gpointer data);
void ygtk_fixed_set_child_pos (YGtkFixed *fixed, GtkWidget *widget, gint x, gint y);
void ygtk_fixed_set_child_size (YGtkFixed *fixed, GtkWidget *widget, gint width, gint height);
Modified: trunk/gtk/src/ygtkhtmlwrap.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkhtmlwrap.c?rev=64969…
==============================================================================
--- trunk/gtk/src/ygtkhtmlwrap.c (original)
+++ trunk/gtk/src/ygtkhtmlwrap.c Sat Jul 23 07:43:30 2011
@@ -6,12 +6,11 @@
// check the header file for information about this widget
#include <config.h>
-#include <gtk/gtkversion.h>
+#include <gtk/gtk.h>
#include <string.h>
#include "ygtkhtmlwrap.h"
// ygutils
-#include <gtk/gtktextview.h>
void ygutils_scrollAdj (GtkAdjustment *vadj, gboolean top);
GtkWidget *ygtk_html_wrap_new (void)
@@ -313,7 +312,7 @@
void ygtk_html_wrap_scroll (GtkWidget *widget, gboolean top)
{
- ygutils_scrollAdj (GTK_TEXT_VIEW (widget)->vadjustment, top);
+ ygutils_scrollAdj (gtk_text_view_get_vadjustment(GTK_TEXT_VIEW (widget)), top);
}
gboolean ygtk_html_wrap_search (GtkWidget *widget, const gchar *text)
Modified: trunk/gtk/src/ygtkhtmlwrap.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkhtmlwrap.h?rev=64969…
==============================================================================
--- trunk/gtk/src/ygtkhtmlwrap.h (original)
+++ trunk/gtk/src/ygtkhtmlwrap.h Sat Jul 23 07:43:30 2011
@@ -11,7 +11,7 @@
#ifndef YGTK_HTML_WRAP_H
#define YGTK_HTML_WRAP_H
-#include <gtk/gtkwidget.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
GtkWidget *ygtk_html_wrap_new (void);
Modified: trunk/gtk/src/ygtkimage.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkimage.c?rev=64969&r1…
==============================================================================
--- trunk/gtk/src/ygtkimage.c (original)
+++ trunk/gtk/src/ygtkimage.c Sat Jul 23 07:43:30 2011
@@ -8,7 +8,7 @@
#include <config.h>
#include "ygdkmngloader.h"
#include "ygtkimage.h"
-#include <gtk/gtkiconfactory.h>
+#include <gtk/gtk.h>
G_DEFINE_TYPE (YGtkImage, ygtk_image, GTK_TYPE_DRAWING_AREA)
@@ -35,14 +35,14 @@
}
}
-static void ygtk_image_destroy (GtkObject *object)
+static void ygtk_image_destroy (GtkWidget *widget)
{
- YGtkImage *image = YGTK_IMAGE (object);
+ YGtkImage *image = YGTK_IMAGE (widget);
if (image->alt_text)
g_free (image->alt_text);
image->alt_text = NULL;
ygtk_image_free_pixbuf (image);
- GTK_OBJECT_CLASS (ygtk_image_parent_class)->destroy (object);
+ GTK_WIDGET_CLASS (ygtk_image_parent_class)->destroy (widget);
}
static void ygtk_image_set_pixbuf (YGtkImage *image, GdkPixbuf *pixbuf, const char *error_msg)
@@ -143,8 +143,8 @@
GError *error = 0;
if (anim && ygdk_mng_pixbuf_is_data_mng (data, data_size)) {
GdkPixbufAnimation *pixbuf;
- pixbuf = ygdk_mng_pixbuf_new_from_data (data, data_size, &error);
- ygtk_image_set_animation (image, pixbuf, error ? error->message : "(undefined)");
+ pixbuf = ygdk_mng_pixbuf_new_from_data (data, data_size, &error);
+ ygtk_image_set_animation (image, pixbuf, error ? error->message : "(undefined)");
}
else {
image->animated = anim;
@@ -190,6 +190,26 @@
requisition->height = height;
}
+static void
+ygtk_image_get_preferred_width (GtkWidget *widget,
+ gint *minimal_width,
+ gint *natural_width)
+{
+ GtkRequisition requisition;
+ ygtk_image_size_request (widget, &requisition);
+ *minimal_width = *natural_width = requisition.width;
+}
+
+static void
+ygtk_image_get_preferred_height (GtkWidget *widget,
+ gint *minimal_height,
+ gint *natural_height)
+{
+ GtkRequisition requisition;
+ ygtk_image_size_request (widget, &requisition);
+ *minimal_height = *natural_height = requisition.height;
+}
+
static GdkPixbuf *ygtk_image_render_state (GtkWidget *widget, GdkPixbuf *pixbuf)
{
// as in GtkImage
@@ -198,21 +218,19 @@
gtk_icon_source_set_pixbuf (source, pixbuf);
gtk_icon_source_set_size (source, GTK_ICON_SIZE_SMALL_TOOLBAR);
gtk_icon_source_set_size_wildcarded (source, FALSE);
- rendered = gtk_style_render_icon (widget->style, source,
- gtk_widget_get_direction (widget), GTK_WIDGET_STATE (widget),
- /* arbitrary */ (GtkIconSize)-1, widget, "gtk-image");
+ rendered = gtk_render_icon_pixbuf (gtk_widget_get_style_context(widget), source, (GtkIconSize)-1);
gtk_icon_source_free (source);
return rendered;
}
-static gboolean ygtk_image_expose_event (GtkWidget *widget, GdkEventExpose *event)
+static gboolean ygtk_image_draw_event (GtkWidget *widget, cairo_t *cr)
{
YGtkImage *image = YGTK_IMAGE (widget);
- int width, height;
- width = widget->allocation.width;
- height = widget->allocation.height;
- cairo_t *cr = gdk_cairo_create (widget->window);
+ GtkRequisition req;
+ gtk_widget_get_preferred_size (widget, &req, NULL);
+ int width = gtk_widget_get_allocated_width(widget);
+ int height = gtk_widget_get_allocated_height(widget);
if (!image->loaded) {
if (image->alt_text) {
@@ -221,15 +239,14 @@
layout = gtk_widget_create_pango_layout (widget, image->alt_text);
int x, y;
- x = (width - widget->requisition.width) / 2;
- y = (height - widget->requisition.height) / 2;
+ x = (width - req.width) / 2;
+ y = (height - req.height) / 2;
cairo_move_to (cr, x, y);
pango_cairo_show_layout (cr, layout);
g_object_unref (layout);
}
- cairo_destroy (cr);
return FALSE;
}
@@ -239,13 +256,13 @@
else
pixbuf = image->pixbuf;
- gboolean needs_transform = GTK_WIDGET_STATE (widget) != GTK_STATE_NORMAL;
+ gboolean needs_transform = gtk_widget_get_state (widget) != GTK_STATE_NORMAL;
if (needs_transform)
pixbuf = ygtk_image_render_state (widget, pixbuf);
int x = 0, y = 0;
if (image->align == CENTER_IMAGE_ALIGN) {
- x = (width - widget->requisition.width) / 2;
- y = (height - widget->requisition.height) / 2;
+ x = (width - req.width) / 2;
+ y = (height - req.height) / 2;
}
gdk_cairo_set_source_pixbuf (cr, pixbuf, x, y);
@@ -270,7 +287,6 @@
cairo_rectangle (cr, x, y, width, height);
cairo_fill (cr);
- cairo_destroy (cr);
if (needs_transform)
g_object_unref (G_OBJECT (pixbuf));
return FALSE;
@@ -284,10 +300,9 @@
static void ygtk_image_class_init (YGtkImageClass *klass)
{
GtkWidgetClass* widget_class = GTK_WIDGET_CLASS (klass);
- widget_class->expose_event = ygtk_image_expose_event;
- widget_class->size_request = ygtk_image_size_request;
-
- GtkObjectClass *gtkobject_class = GTK_OBJECT_CLASS (klass);
- gtkobject_class->destroy = ygtk_image_destroy;
+ widget_class->draw = ygtk_image_draw_event;
+ widget_class->get_preferred_width = ygtk_image_get_preferred_width;
+ widget_class->get_preferred_height = ygtk_image_get_preferred_height;
+ widget_class->destroy = ygtk_image_destroy;
}
Modified: trunk/gtk/src/ygtkimage.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkimage.h?rev=64969&r1…
==============================================================================
--- trunk/gtk/src/ygtkimage.h (original)
+++ trunk/gtk/src/ygtkimage.h Sat Jul 23 07:43:30 2011
@@ -10,8 +10,8 @@
#ifndef YGTK_IMAGE_H
#define YGTK_IMAGE_H
-#include <gtk/gtkdrawingarea.h>
-#include <gdk/gdkpixbuf.h>
+#include <gtk/gtk.h>
+#include <gdk/gdk.h>
G_BEGIN_DECLS
@@ -68,7 +68,7 @@
void ygtk_image_set_from_pixbuf (YGtkImage *image, GdkPixbuf *pixbuf);
void ygtk_image_set_props (YGtkImage *image, YGtkImageAlign align, const gchar *alt_text);
-// as we don't have a window,
+// as we don't have a window,
G_END_DECLS
Modified: trunk/gtk/src/ygtklinklabel.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtklinklabel.c?rev=6496…
==============================================================================
--- trunk/gtk/src/ygtklinklabel.c (original)
+++ trunk/gtk/src/ygtklinklabel.c Sat Jul 23 07:43:30 2011
@@ -16,17 +16,19 @@
static void ygtk_link_label_init (YGtkLinkLabel *label)
{
- GTK_WIDGET_SET_FLAGS (label, GTK_NO_WINDOW);
+ gtk_widget_set_has_window(GTK_WIDGET(label), FALSE);
}
static void ygtk_link_label_realize (GtkWidget *widget)
{
GTK_WIDGET_CLASS (ygtk_link_label_parent_class)->realize (widget);
GdkWindowAttr attributes;
- attributes.x = widget->allocation.x;
- attributes.y = widget->allocation.y;
- attributes.width = widget->allocation.width;
- attributes.height = widget->allocation.height;
+ GtkAllocation alloc;
+ gtk_widget_get_allocation(widget, &alloc);
+ attributes.x = alloc.x;
+ attributes.y = alloc.y;
+ attributes.width = alloc.width;
+ attributes.height = alloc.height;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.event_mask = gtk_widget_get_events (widget) |
@@ -36,12 +38,11 @@
gtk_widget_get_display (widget), GDK_HAND2);
YGtkLinkLabel *label = YGTK_LINK_LABEL (widget);
- label->link_window = gdk_window_new (widget->window, &attributes, attributes_mask);
+ label->link_window = gdk_window_new (gtk_widget_get_window(widget), &attributes, attributes_mask);
gdk_window_set_user_data (label->link_window, widget);
GdkColor white = { 0, 0xffff, 0xffff, 0xffff };
- gdk_rgb_find_color (gtk_widget_get_colormap (widget), &white);
gdk_window_set_background (label->link_window, &white);
- gdk_cursor_unref (attributes.cursor);
+ g_object_unref (G_OBJECT(attributes.cursor));
}
static void ygtk_link_label_unrealize (GtkWidget *widget)
@@ -108,13 +109,15 @@
YGtkLinkLabel *label = YGTK_LINK_LABEL (widget);
ygtk_link_label_ensure_layout (label);
requisition->width = requisition->height = 0;
+ GtkStyleContext *style_ctx;
+ style_ctx = gtk_widget_get_style_context(widget);
// if (label->text && *label->text)
{
PangoContext *context;
PangoFontMetrics *metrics;
gint ascent, descent;
context = pango_layout_get_context (label->layout);
- metrics = pango_context_get_metrics (context, widget->style->font_desc,
+ metrics = pango_context_get_metrics (context, gtk_style_context_get_font(style_ctx, GTK_STATE_FLAG_NORMAL),
pango_context_get_language (context));
ascent = pango_font_metrics_get_ascent (metrics);
descent = pango_font_metrics_get_descent (metrics);
@@ -123,6 +126,26 @@
}
}
+static void
+ygtk_link_label_get_preferred_width (GtkWidget *widget,
+ gint *minimal_width,
+ gint *natural_width)
+{
+ GtkRequisition requisition;
+ ygtk_link_label_size_request (widget, &requisition);
+ *minimal_width = *natural_width = requisition.width;
+}
+
+static void
+ygtk_link_label_get_preferred_height (GtkWidget *widget,
+ gint *minimal_height,
+ gint *natural_height)
+{
+ GtkRequisition requisition;
+ ygtk_link_label_size_request (widget, &requisition);
+ *minimal_height = *natural_height = requisition.height;
+}
+
#define SPACING 4
static void ygtk_link_label_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
@@ -158,29 +181,27 @@
}
}
-static gboolean ygtk_link_label_expose_event (GtkWidget *widget, GdkEventExpose *event)
+static gboolean ygtk_link_label_on_draw (GtkWidget *widget, cairo_t *cr)
{
YGtkLinkLabel *label = YGTK_LINK_LABEL (widget);
ygtk_link_label_ensure_layout (label);
- gint x = 0, y = 0;
- PangoLayout *layout = 0;
- if (event->window == widget->window) {
+ GtkStyleContext *style = gtk_widget_get_style_context(widget);
+ if (gtk_cairo_should_draw_window(cr, gtk_widget_get_window(widget))) {
+ gint x = 0;
+ gint width = gtk_widget_get_allocated_width (widget);
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) {
PangoRectangle extent;
pango_layout_get_extents (label->layout, NULL, &extent);
- x = widget->allocation.width - extent.width/PANGO_SCALE;
+ x = width - extent.width/PANGO_SCALE;
}
- x += widget->allocation.x;
- y += widget->allocation.y;
- layout = label->layout;
- }
- else if (event->window == label->link_window)
- layout = label->link_layout;
-
- if (layout)
- gtk_paint_layout (widget->style, event->window, GTK_WIDGET_STATE (widget),
- FALSE, &event->area, widget, "label", x, y, layout);
+ gtk_render_layout (style, cr, x, 0, label->layout);
+ }
+
+ if (gtk_cairo_should_draw_window(cr, label->link_window)) {
+ gtk_cairo_transform_to_window (cr, widget, label->link_window);
+ gtk_render_layout (style, cr, 0, 0, label->link_layout);
+ }
return FALSE;
}
@@ -190,8 +211,8 @@
return TRUE;
}
-void ygtk_link_label_set_text (YGtkLinkLabel *label, const gchar *text, const gchar *link,
- gboolean link_always_visible)
+void ygtk_link_label_set_text (YGtkLinkLabel *label,
+ const gchar *text, const gchar *link, gboolean link_always_visible)
{
g_free (label->text);
label->text = g_strdup (text);
@@ -219,9 +240,12 @@
widget_class->realize = ygtk_link_label_realize;
widget_class->unrealize = ygtk_link_label_unrealize;
widget_class->map = ygtk_link_label_map;
- widget_class->size_request = ygtk_link_label_size_request;
+
+ widget_class->get_preferred_height = ygtk_link_label_get_preferred_height;
+ widget_class->get_preferred_width = ygtk_link_label_get_preferred_width;
+
widget_class->size_allocate = ygtk_link_label_size_allocate;
- widget_class->expose_event = ygtk_link_label_expose_event;
+ widget_class->draw = ygtk_link_label_on_draw;
widget_class->button_press_event = ygtk_link_label_button_press_event;
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
Modified: trunk/gtk/src/ygtklinklabel.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtklinklabel.h?rev=6496…
==============================================================================
--- trunk/gtk/src/ygtklinklabel.h (original)
+++ trunk/gtk/src/ygtklinklabel.h Sat Jul 23 07:43:30 2011
@@ -12,7 +12,7 @@
#ifndef YGTK_LINK_LABEL_H
#define YGTK_LINK_LABEL_H
-#include <gtk/gtkwidget.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
#define YGTK_TYPE_LINK_LABEL (ygtk_link_label_get_type ())
Modified: trunk/gtk/src/ygtkmenubutton.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkmenubutton.c?rev=649…
==============================================================================
--- trunk/gtk/src/ygtkmenubutton.c (original)
+++ trunk/gtk/src/ygtkmenubutton.c Sat Jul 23 07:43:30 2011
@@ -33,7 +33,7 @@
static gboolean ygtk_popup_window_key_press_event (GtkWidget *widget, GdkEventKey *event)
{
- if (event->keyval == GDK_Escape) {
+ if (event->keyval == GDK_KEY_Escape) {
gtk_widget_hide (widget);
return TRUE;
}
@@ -54,7 +54,7 @@
while (child) {
if (child == widget)
return FALSE;
- child = child->parent;
+ child = gtk_widget_get_parent(child);
}
gtk_widget_hide (widget);
return TRUE;
@@ -88,7 +88,7 @@
*y = monitor.y;
else if (*y + req.height > monitor.y + monitor.height)
*y = monitor.y + monitor.height - req.height;
-}
+}
void ygtk_popup_window_popup (GtkWidget *widget, gint x, gint y, guint activate_time)
{
@@ -100,10 +100,10 @@
gtk_widget_show (widget);
// grab this with your teeth
- if (gdk_pointer_grab (widget->window, TRUE,
+ if (gdk_pointer_grab (gtk_widget_get_window(widget), TRUE,
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK,
NULL, NULL, activate_time) == 0)
- if (gdk_keyboard_grab (widget->window, TRUE, activate_time) != 0)
+ if (gdk_keyboard_grab (gtk_widget_get_window(widget), TRUE, activate_time) != 0)
gdk_pointer_ungrab (activate_time);
}
@@ -143,26 +143,27 @@
static void ygtk_menu_button_get_popup_pos (YGtkMenuButton *button, gint *x, gint *y)
{
GtkWidget *widget = GTK_WIDGET (button);
- GtkAllocation *button_alloc = &widget->allocation;
+ GtkAllocation button_alloc;
+ gtk_widget_get_allocation(widget, &button_alloc);
// the popup would look awful if smaller than the button
GtkRequisition req;
gtk_widget_size_request (button->popup, &req);
int popup_width = req.width, popup_height = req.height;
- if (button_alloc->width > req.width) {
- gtk_widget_set_size_request (button->popup, button_alloc->width, -1);
- popup_width = button_alloc->width;
+ if (button_alloc.width > req.width) {
+ gtk_widget_set_size_request (button->popup, button_alloc.width, -1);
+ popup_width = button_alloc.width;
}
- gdk_window_get_origin (widget->window, x, y);
- *x += button_alloc->x - popup_width*button->xalign;
- *y += (button_alloc->y-popup_height) + (button_alloc->height+popup_height)*button->yalign;
+ gdk_window_get_origin (gtk_widget_get_window(widget), x, y);
+ *x += button_alloc.x - popup_width*button->xalign;
+ *y += (button_alloc.y-popup_height) + (button_alloc.height+popup_height)*button->yalign;
// GTK doesn't push up menus if they are near the bottom, but we will...
int screen_height;
screen_height = gdk_screen_get_height (gtk_widget_get_screen (widget));
if (*y > screen_height - popup_height)
- *y -= popup_height + button_alloc->height;
+ *y -= popup_height + button_alloc.height;
}
static void ygtk_menu_button_get_menu_pos (GtkMenu *menu, gint *x, gint *y,
Modified: trunk/gtk/src/ygtkmenubutton.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkmenubutton.h?rev=649…
==============================================================================
--- trunk/gtk/src/ygtkmenubutton.h (original)
+++ trunk/gtk/src/ygtkmenubutton.h Sat Jul 23 07:43:30 2011
@@ -11,7 +11,7 @@
#ifndef YGTK_POPUP_WINDOW_H
#define YGTK_POPUP_WINDOW_H
-#include <gtk/gtkwindow.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
#define YGTK_TYPE_POPUP_WINDOW (ygtk_popup_window_get_type ())
@@ -48,8 +48,6 @@
#ifndef YGTK_MENU_BUTTON_H
#define YGTK_MENU_BUTTON_H
-#include <gtk/gtktogglebutton.h>
-#include <gtk/gtkmenu.h>
G_BEGIN_DECLS
#define YGTK_TYPE_MENU_BUTTON (ygtk_menu_button_get_type ())
Modified: trunk/gtk/src/ygtkratiobox.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkratiobox.c?rev=64969…
==============================================================================
--- trunk/gtk/src/ygtkratiobox.c (original)
+++ trunk/gtk/src/ygtkratiobox.c Sat Jul 23 07:43:30 2011
@@ -13,7 +13,7 @@
static void ygtk_ratio_box_init (YGtkRatioBox *box)
{
- GTK_WIDGET_SET_FLAGS (box, GTK_NO_WINDOW);
+ gtk_widget_set_has_window (GTK_WIDGET(box), FALSE);
gtk_widget_set_redraw_on_allocate (GTK_WIDGET (box), FALSE);
}
@@ -61,7 +61,7 @@
for (child = box->children; child; child = child->next) {
YGtkRatioBoxChild *box_child = (YGtkRatioBoxChild*) child->data;
if (box_child->widget == widget) {
- gboolean was_visible = GTK_WIDGET_VISIBLE (widget);
+ gboolean was_visible = gtk_widget_get_visible (widget);
gtk_widget_unparent (widget);
box->children = g_list_remove_link (box->children, child);
@@ -93,10 +93,9 @@
/* We put size_request and _allocate in the same functions for both
orientations because it's just easier to maintain having the
logic in the same place. */
-
-static void ygtk_ratio_box_size_request (GtkWidget *widget,
- GtkRequisition *requisition,
- GtkOrientation orientation)
+static void ygtk_ratio_box_get_preferred_size (GtkWidget *widget,
+ GtkRequisition *requisition,
+ GtkOrientation orientation)
{
requisition->width = requisition->height = 0;
@@ -105,15 +104,16 @@
GList *i;
for (i = box->children; i; i = i->next) {
YGtkRatioBoxChild* child = i->data;
- if (!GTK_WIDGET_VISIBLE (child->widget))
+ if (!gtk_widget_get_visible (child->widget))
continue;
- GtkRequisition child_req;
- gtk_widget_size_request (child->widget, &child_req);
+ GtkRequisition min_child_req;
+ GtkRequisition nat_child_req;
+ gtk_widget_get_preferred_size (child->widget, &min_child_req, &nat_child_req);
if (orientation == GTK_ORIENTATION_HORIZONTAL)
- requisition->height = MAX (requisition->height, child_req.height);
+ requisition->height = MAX (requisition->height, min_child_req.height);
else
- requisition->width = MAX (requisition->width, child_req.width);
+ requisition->width = MAX (requisition->width, min_child_req.width);
children_nb++;
}
gint spacing = children_nb ? box->spacing*(children_nb-1) : 0;
@@ -122,7 +122,7 @@
else
requisition->height += spacing;
- int border = GTK_CONTAINER (box)->border_width;
+ int border = gtk_container_get_border_width(GTK_CONTAINER (box));
requisition->width += border*2;
requisition->height += border*2;
}
@@ -139,7 +139,7 @@
GList* i;
for (i = box->children; i; i = i->next) {
YGtkRatioBoxChild* child = i->data;
- if (!GTK_WIDGET_VISIBLE (child->widget))
+ if (!gtk_widget_get_visible (child->widget))
continue;
ratios_sum += child->ratio;
@@ -148,7 +148,7 @@
gint spacing = children_nb ? box->spacing*(children_nb-1) : 0;
- int border = GTK_CONTAINER (box)->border_width;
+ int border = gtk_container_get_border_width(GTK_CONTAINER (box));
int x = allocation->x + border, y = allocation->y + border,
width = allocation->width - border*2, height = allocation->height - border*2;
@@ -161,11 +161,12 @@
for (i = box->children; i; i = i->next) {
YGtkRatioBoxChild* child = i->data;
- if (!GTK_WIDGET_VISIBLE (child->widget))
+ if (!gtk_widget_get_visible (child->widget))
continue;
- GtkRequisition child_req;
- gtk_widget_get_child_requisition (child->widget, &child_req);
+ //GtkRequisition min_child_req;
+ //GtkRequisition nat_child_req;
+ //gtk_widget_get_preferred_size (child->widget, &min_child_req, &nat_child_req);
gint child_length = (child->ratio * length) / ratios_sum;
if (!i->next) // last takes rest (any residual length)
@@ -199,7 +200,7 @@
if (child_info) {
gtk_widget_freeze_child_notify (child);
child_info->ratio = ratio;
- if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (box))
+ if (gtk_widget_get_visible (child) && gtk_widget_get_visible (GTK_WIDGET(box)))
gtk_widget_queue_resize (child);
gtk_widget_thaw_child_notify (child);
@@ -229,9 +230,29 @@
static void ygtk_ratio_hbox_init (YGtkRatioHBox *box)
{ }
-static void ygtk_ratio_hbox_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
-{ ygtk_ratio_box_size_request (widget, requisition, GTK_ORIENTATION_HORIZONTAL); }
+static void ygtk_ratio_hbox_get_preferred_size (GtkWidget *widget,
+ GtkRequisition *requisition)
+{ ygtk_ratio_box_get_preferred_size (widget, requisition, GTK_ORIENTATION_HORIZONTAL); }
+
+static void
+ygtk_ratio_hbox_get_preferred_width (GtkWidget *widget,
+ gint *minimal_width,
+ gint *natural_width)
+{
+ GtkRequisition requisition;
+ ygtk_ratio_hbox_get_preferred_size (widget, &requisition);
+ *minimal_width = *natural_width = requisition.width;
+}
+
+static void
+ygtk_ratio_hbox_get_preferred_height (GtkWidget *widget,
+ gint *minimal_height,
+ gint *natural_height)
+{
+ GtkRequisition requisition;
+ ygtk_ratio_hbox_get_preferred_size (widget, &requisition);
+ *minimal_height = *natural_height = requisition.height;
+}
static void ygtk_ratio_hbox_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
@@ -249,7 +270,9 @@
ygtk_ratio_hbox_parent_class = (YGtkRatioBoxClass*) g_type_class_peek_parent (klass);
GtkWidgetClass* widget_class = GTK_WIDGET_CLASS (klass);
- widget_class->size_request = ygtk_ratio_hbox_size_request;
+ widget_class->get_preferred_width = ygtk_ratio_hbox_get_preferred_width;
+ widget_class->get_preferred_height = ygtk_ratio_hbox_get_preferred_height;
+
widget_class->size_allocate = ygtk_ratio_hbox_size_allocate;
}
@@ -260,9 +283,29 @@
static void ygtk_ratio_vbox_init (YGtkRatioVBox *box)
{ }
-static void ygtk_ratio_vbox_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
-{ ygtk_ratio_box_size_request (widget, requisition, GTK_ORIENTATION_VERTICAL); }
+static void ygtk_ratio_vbox_get_preferred_size (GtkWidget *widget,
+ GtkRequisition *requisition)
+{ ygtk_ratio_box_get_preferred_size (widget, requisition, GTK_ORIENTATION_VERTICAL); }
+
+static void
+ygtk_ratio_vbox_get_preferred_width (GtkWidget *widget,
+ gint *minimal_width,
+ gint *natural_width)
+{
+ GtkRequisition requisition;
+ ygtk_ratio_vbox_get_preferred_size (widget, &requisition);
+ *minimal_width = *natural_width = requisition.width;
+}
+
+static void
+ygtk_ratio_vbox_get_preferred_height (GtkWidget *widget,
+ gint *minimal_height,
+ gint *natural_height)
+{
+ GtkRequisition requisition;
+ ygtk_ratio_vbox_get_preferred_size (widget, &requisition);
+ *minimal_height = *natural_height = requisition.height;
+}
static void ygtk_ratio_vbox_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
@@ -280,7 +323,8 @@
ygtk_ratio_vbox_parent_class = g_type_class_peek_parent (klass);
GtkWidgetClass* widget_class = GTK_WIDGET_CLASS (klass);
- widget_class->size_request = ygtk_ratio_vbox_size_request;
+ widget_class->get_preferred_width = ygtk_ratio_vbox_get_preferred_width;
+ widget_class->get_preferred_height = ygtk_ratio_vbox_get_preferred_height;
widget_class->size_allocate = ygtk_ratio_vbox_size_allocate;
}
@@ -290,18 +334,18 @@
static void ygtk_adj_size_init (YGtkAdjSize *adj_size)
{
- GTK_WIDGET_SET_FLAGS (adj_size, GTK_NO_WINDOW);
+ gtk_widget_set_has_window(GTK_WIDGET(adj_size), FALSE);
gtk_widget_set_redraw_on_allocate (GTK_WIDGET (adj_size), FALSE);
}
-static void ygtk_adj_size_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
+static void ygtk_adj_size_get_preferred_size (GtkWidget *widget,
+ GtkRequisition *requisition)
{
- GtkWidget *child = GTK_BIN (widget)->child;
+ GtkWidget *child = gtk_bin_get_child(GTK_BIN (widget));
requisition->width = requisition->height = 0;
- if (child && GTK_WIDGET_VISIBLE (child)) {
+ if (child && gtk_widget_get_visible((child))) {
gtk_widget_size_request (child, requisition);
- guint border = GTK_CONTAINER (widget)->border_width;
+ guint border = gtk_container_get_border_width(GTK_CONTAINER (widget));
requisition->width += border * 2;
requisition->height += border * 2;
@@ -327,13 +371,34 @@
}
}
+static void
+ygtk_adj_size_get_preferred_width (GtkWidget *widget,
+ gint *minimal_width,
+ gint *natural_width)
+{
+ GtkRequisition requisition;
+ ygtk_adj_size_get_preferred_size (widget, &requisition);
+ *minimal_width = *natural_width = requisition.width;
+}
+
+static void
+ygtk_adj_size_get_preferred_height (GtkWidget *widget,
+ gint *minimal_height,
+ gint *natural_height)
+{
+ GtkRequisition requisition;
+ ygtk_adj_size_get_preferred_size (widget, &requisition);
+ *minimal_height = *natural_height = requisition.height;
+}
+
+
static void ygtk_adj_size_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
- GtkWidget *child = GTK_BIN (widget)->child;
- if (child && GTK_WIDGET_VISIBLE (child)) {
+ GtkWidget *child = gtk_bin_get_child(GTK_BIN (widget));
+ if (child && gtk_widget_get_visible (child)) {
GtkAllocation child_alloc = *allocation;
- guint border = GTK_CONTAINER (widget)->border_width;
+ guint border = gtk_container_get_border_width(GTK_CONTAINER (widget));
child_alloc.x += border;
child_alloc.y += border;
child_alloc.width -= border * 2;
@@ -378,7 +443,8 @@
ygtk_adj_size_parent_class = g_type_class_peek_parent (klass);
GtkWidgetClass* widget_class = GTK_WIDGET_CLASS (klass);
- widget_class->size_request = ygtk_adj_size_size_request;
+ widget_class->get_preferred_width = ygtk_adj_size_get_preferred_width;
+ widget_class->get_preferred_height = ygtk_adj_size_get_preferred_height;
widget_class->size_allocate = ygtk_adj_size_size_allocate;
}
Modified: trunk/gtk/src/ygtkratiobox.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkratiobox.h?rev=64969…
==============================================================================
--- trunk/gtk/src/ygtkratiobox.h (original)
+++ trunk/gtk/src/ygtkratiobox.h Sat Jul 23 07:43:30 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_RATIO_BOX_H
#define YGTK_RATIO_BOX_H
-#include <gtk/gtkcontainer.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
#define YGTK_TYPE_RATIO_BOX (ygtk_ratio_box_get_type ())
@@ -112,7 +112,6 @@
#ifndef YGTK_ADJ_SIZE_H
#define YGTK_ADJ_SIZE_H
-#include <gtk/gtkbin.h>
G_BEGIN_DECLS
#define YGTK_TYPE_ADJ_SIZE (ygtk_adj_size_get_type ())
Modified: trunk/gtk/src/ygtkrichtext.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkrichtext.c?rev=64969…
==============================================================================
--- trunk/gtk/src/ygtkrichtext.c (original)
+++ trunk/gtk/src/ygtkrichtext.c Sat Jul 23 07:43:30 2011
@@ -150,13 +150,13 @@
"foreground", "#000000", NULL);
}
-static void ygtk_rich_text_destroy (GtkObject *object)
+static void ygtk_rich_text_destroy (GtkWidget *widget)
{
// destroy can be called multiple times, and we must ref only once
- YGtkRichText *rtext = YGTK_RICH_TEXT (object);
+ YGtkRichText *rtext = YGTK_RICH_TEXT (widget);
gdk_cursor_unref (rtext->hand_cursor);
ygtk_rich_text_set_background (rtext, NULL);
- GTK_OBJECT_CLASS (ygtk_rich_text_parent_class)->destroy (object);
+ GTK_WIDGET_CLASS (ygtk_rich_text_parent_class)->destroy(widget);
}
// Change the cursor to the "hands" cursor typically used by web browsers,
@@ -165,9 +165,12 @@
{
if (wx == -1) {
GtkWidget *widget = GTK_WIDGET (view);
- gdk_window_get_pointer (widget->window, &wx, &wy, NULL);
- if (wx < 0 || wy < 0 || wx >= widget->allocation.width ||
- wy >= widget->allocation.height)
+ GtkAllocation alloc;
+ gtk_widget_get_allocation(widget, &alloc);
+
+ gdk_window_get_pointer (gtk_widget_get_window(widget), &wx, &wy, NULL);
+ if (wx < 0 || wy < 0 || wx >= alloc.width ||
+ wy >= alloc.height)
return;
}
@@ -191,25 +194,29 @@
return TRUE;
}
-static gboolean ygtk_rich_text_expose_event (GtkWidget *widget, GdkEventExpose *event)
+static gboolean ygtk_rich_text_draw (GtkWidget *widget, cairo_t *cr)
{
GtkTextView *text = GTK_TEXT_VIEW (widget);
YGtkRichText *rtext = YGTK_RICH_TEXT (widget);
+ GtkAllocation alloc;
+ gtk_widget_get_allocation(widget, &alloc);
if (rtext->background_pixbuf) {
GdkWindow *window = gtk_text_view_get_window (text, GTK_TEXT_WINDOW_TEXT);
- if (event->window == window) {
+ if (gtk_cairo_should_draw_window(cr, window)) {
int x, y;
int width = gdk_pixbuf_get_width (rtext->background_pixbuf);
int height = gdk_pixbuf_get_height (rtext->background_pixbuf);
gtk_text_view_buffer_to_window_coords (text, GTK_TEXT_WINDOW_TEXT,
- widget->allocation.width-((2*width)/5), -height/3, &x, &y);
- gdk_draw_pixbuf (GDK_DRAWABLE (window), *widget->style->fg_gc, rtext->background_pixbuf,
- 0, 0, x, y, -1, -1, GDK_RGB_DITHER_NONE, 0, 0);
+ alloc.width-((2*width)/5), -height/3, &x, &y);
+
+ gtk_cairo_transform_to_window(cr, widget, window);
+ gdk_cairo_set_source_pixbuf (cr, rtext->background_pixbuf, x, y);
+ cairo_paint (cr);
}
}
gboolean ret;
- ret = GTK_WIDGET_CLASS (ygtk_rich_text_parent_class)->expose_event (widget, event);
+ ret = GTK_WIDGET_CLASS (ygtk_rich_text_parent_class)->draw (widget, cr);
set_cursor_if_appropriate (text, -1, -1);
return ret;
}
@@ -722,10 +729,8 @@
{
GtkWidgetClass *gtkwidget_class = GTK_WIDGET_CLASS (klass);
gtkwidget_class->motion_notify_event = ygtk_rich_text_motion_notify_event;
- gtkwidget_class->expose_event = ygtk_rich_text_expose_event;
-
- GtkObjectClass *gtkobject_class = GTK_OBJECT_CLASS (klass);
- gtkobject_class->destroy = ygtk_rich_text_destroy;
+ gtkwidget_class->draw = ygtk_rich_text_draw;
+ gtkwidget_class->destroy = ygtk_rich_text_destroy;
link_clicked_signal = g_signal_new ("link-clicked",
G_TYPE_FROM_CLASS (G_OBJECT_CLASS (klass)), G_SIGNAL_RUN_LAST,
Modified: trunk/gtk/src/ygtksteps.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtksteps.c?rev=64969&r1…
==============================================================================
--- trunk/gtk/src/ygtksteps.c (original)
+++ trunk/gtk/src/ygtksteps.c Sat Jul 23 07:43:30 2011
@@ -39,9 +39,9 @@
steps->current_mark_timeout_id = steps->current_mark_frame = 0;
}
-static void ygtk_steps_destroy (GtkObject *object)
+static void ygtk_steps_destroy (GtkWidget *widget)
{
- YGtkSteps *steps = YGTK_STEPS (object);
+ YGtkSteps *steps = YGTK_STEPS (widget);
if (steps->current_mark_timeout_id) {
g_source_remove (steps->current_mark_timeout_id);
steps->current_mark_timeout_id = 0;
@@ -54,7 +54,8 @@
if (steps->todo_mark_layout)
g_object_unref (steps->todo_mark_layout);
steps->todo_mark_layout = NULL;
- GTK_OBJECT_CLASS (ygtk_steps_parent_class)->destroy (object);
+
+ GTK_WIDGET_CLASS (ygtk_steps_parent_class)->destroy(widget);
}
static void ygtk_step_update_layout (YGtkSteps *steps, gint step)
@@ -79,19 +80,21 @@
g_list_free (children);
}
-static gboolean ygtk_steps_expose_event (GtkWidget *widget, GdkEventExpose *event)
+static gboolean ygtk_steps_draw (GtkWidget *widget, cairo_t *cr)
{
- GTK_WIDGET_CLASS (ygtk_steps_parent_class)->expose_event (widget, event);
+ GTK_WIDGET_CLASS (ygtk_steps_parent_class)->draw(widget, cr);
YGtkSteps *steps = YGTK_STEPS (widget);
gboolean reverse = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
GList *children = gtk_container_get_children (GTK_CONTAINER (widget)), *i;
- cairo_t *cr = gdk_cairo_create (event->window);
cairo_set_source_rgb (cr, 0, 0, 0);
int n = 0;
for (i = children; i; i = i->next, n++) {
GtkWidget *label = i->data;
+ GtkAllocation alloc;
+ gtk_widget_get_allocation(label, &alloc);
+
if (g_object_get_data (G_OBJECT (label), "is-header"))
continue;
PangoLayout *layout;
@@ -101,11 +104,11 @@
layout = steps->current_mark_layout;
else //if (n > steps->current_step)
layout = steps->todo_mark_layout;
- int x = label->allocation.x, y = label->allocation.y;
+ int x = alloc.x, y = alloc.y;
if (reverse) {
PangoRectangle rect;
pango_layout_get_pixel_extents (layout, NULL, &rect);
- x += label->allocation.width - rect.width - 4;
+ x += alloc.width - rect.width - 4;
}
else
x += 4;
@@ -122,7 +125,6 @@
cairo_move_to (cr, x, y);
pango_cairo_show_layout (cr, layout);
}
- cairo_destroy (cr);
g_list_free (children);
return FALSE;
}
@@ -189,7 +191,7 @@
ygtk_step_update_layout (steps, step);
}
- if (step != -1) {
+ if (step != -1 && step != old_step) {
steps->current_mark_frame = 0;
steps->current_mark_timeout_id = g_timeout_add
(CURRENT_MARK_ANIMATION_TIME / CURRENT_MARK_FRAMES_NB,
@@ -230,9 +232,7 @@
ygtk_steps_parent_class = g_type_class_peek_parent (klass);
GtkWidgetClass* widget_class = GTK_WIDGET_CLASS (klass);
- widget_class->expose_event = ygtk_steps_expose_event;
-
- GtkObjectClass *gtkobject_class = GTK_OBJECT_CLASS (klass);
- gtkobject_class->destroy = ygtk_steps_destroy;
+ widget_class->draw = ygtk_steps_draw;
+ widget_class->destroy = ygtk_steps_destroy;
}
Modified: trunk/gtk/src/ygtksteps.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtksteps.h?rev=64969&r1…
==============================================================================
--- trunk/gtk/src/ygtksteps.h (original)
+++ trunk/gtk/src/ygtksteps.h Sat Jul 23 07:43:30 2011
@@ -18,7 +18,7 @@
#ifndef YGTK_STEPS_H
#define YGTK_STEPS_H
-#include <gtk/gtkvbox.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
#define YGTK_TYPE_STEPS (ygtk_steps_get_type ())
@@ -42,7 +42,7 @@
PangoLayout *check_mark_layout, *current_mark_layout, *todo_mark_layout;
// for current_mark little animation
guint current_mark_timeout_id, current_mark_frame;
-
+
} YGtkSteps;
typedef struct _YGtkStepsClass
Modified: trunk/gtk/src/ygtktextview.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtktextview.h?rev=64969…
==============================================================================
--- trunk/gtk/src/ygtktextview.h (original)
+++ trunk/gtk/src/ygtktextview.h Sat Jul 23 07:43:30 2011
@@ -9,7 +9,7 @@
#ifndef YGTK_TEXT_VIEW_H
#define YGTK_TEXT_VIEW_H
-#include <gtk/gtktextview.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
#define YGTK_TYPE_TEXT_VIEW (ygtk_text_view_get_type ())
Modified: trunk/gtk/src/ygtktimezonepicker.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtktimezonepicker.c?rev…
==============================================================================
--- trunk/gtk/src/ygtktimezonepicker.c (original)
+++ trunk/gtk/src/ygtktimezonepicker.c Sat Jul 23 07:43:30 2011
@@ -72,7 +72,8 @@
gint *map_x, gint *map_y)
{
int win_width, win_height;
- gdk_window_get_size (picker->map_window, &win_width, &win_height);
+ win_width = gdk_window_get_width(picker->map_window);
+ win_height = gdk_window_get_height(picker->map_window);
*map_x = ((win_x - win_width/2) / picker->scale) + picker->map_x;
*map_y = ((win_y - win_height/2) / picker->scale) + picker->map_y;
@@ -82,7 +83,8 @@
gint *win_x, gint *win_y)
{
int win_width, win_height;
- gdk_window_get_size (picker->map_window, &win_width, &win_height);
+ win_width = gdk_window_get_width(picker->map_window);
+ win_height = gdk_window_get_height(picker->map_window);
*win_x = ((map_x - picker->map_x) * picker->scale) + win_width/2;
*win_y = ((map_y - picker->map_y) * picker->scale) + win_height/2;
@@ -244,12 +246,12 @@
static void ygtk_time_zone_picker_init (YGtkTimeZonePicker *picker)
{
- GTK_WIDGET_SET_FLAGS (picker, GTK_NO_WINDOW);
+ gtk_widget_set_has_window (GTK_WIDGET(picker), FALSE);
}
-static void ygtk_time_zone_picker_destroy (GtkObject *object)
+static void ygtk_time_zone_picker_destroy (GtkWidget *widget)
{
- YGtkTimeZonePicker *picker = YGTK_TIME_ZONE_PICKER (object);
+ YGtkTimeZonePicker *picker = YGTK_TIME_ZONE_PICKER (widget);
if (picker->map_pixbuf) {
g_object_unref (G_OBJECT (picker->map_pixbuf));
picker->map_pixbuf = NULL;
@@ -267,7 +269,7 @@
g_list_free (picker->locations);
picker->locations = NULL;
}
- GTK_OBJECT_CLASS (ygtk_time_zone_picker_parent_class)->destroy (object);
+ GTK_WIDGET_CLASS (ygtk_time_zone_picker_parent_class)->destroy(widget);
}
static void ygtk_time_zone_picker_realize (GtkWidget *widget)
@@ -277,11 +279,14 @@
YGtkTimeZonePicker *picker = YGTK_TIME_ZONE_PICKER (widget);
GdkWindowAttr attributes;
+ GtkAllocation alloc;
+ gtk_widget_get_allocation(widget, &alloc);
+
attributes.window_type = GDK_WINDOW_CHILD;
- attributes.x = widget->allocation.x;
- attributes.y = widget->allocation.y;
- attributes.width = widget->allocation.width;
- attributes.height = widget->allocation.height;
+ attributes.x = alloc.x;
+ attributes.y = alloc.y;
+ attributes.width = alloc.width;
+ attributes.height = alloc.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.event_mask = gtk_widget_get_events (widget);
attributes.event_mask |=
@@ -289,10 +294,12 @@
| GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK);
gint attributes_mask;
attributes_mask = GDK_WA_X | GDK_WA_Y;
- picker->map_window = gdk_window_new (widget->window,
+ picker->map_window = gdk_window_new (gtk_widget_get_window(widget),
&attributes, attributes_mask);
gdk_window_set_user_data (picker->map_window, widget);
- gtk_style_set_background (widget->style, picker->map_window, GTK_STATE_NORMAL);
+
+ GtkStyleContext *style_ctx = gtk_widget_get_style_context(widget);
+ gtk_style_context_set_background(style_ctx, picker->map_window);
ygtk_time_zone_picker_closeup (picker, FALSE, 0, 0, FALSE);
}
@@ -399,18 +406,22 @@
return FALSE;
}
-static void ygtk_time_zone_picker_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
+static void ygtk_time_zone_picker_get_preferred_width (GtkWidget *widget,
+ gint *minimal_width, gint *natural_width)
{
- requisition->width = 600;
- requisition->height = 300;
- GTK_WIDGET_CLASS (ygtk_time_zone_picker_parent_class)->size_request (widget, requisition);
+ *minimal_width = *natural_width = 600;
+}
+
+static void ygtk_time_zone_picker_get_preferred_height (GtkWidget *widget,
+ gint *minimal_height, gint *natural_height)
+{
+ *minimal_height = *natural_height = 300;
}
static void ygtk_time_zone_picker_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
- if (!GTK_WIDGET_REALIZED (widget))
+ if (!gtk_widget_get_realized (widget))
return;
YGtkTimeZonePicker *picker = YGTK_TIME_ZONE_PICKER (widget);
int win_width = allocation->width, win_height = allocation->height;
@@ -443,16 +454,13 @@
(widget, allocation);
}
-static gboolean ygtk_time_zone_picker_expose_event (GtkWidget *widget,
- GdkEventExpose *event)
+static gboolean ygtk_time_zone_picker_draw (GtkWidget *widget, cairo_t *cr)
{
YGtkTimeZonePicker *picker = YGTK_TIME_ZONE_PICKER (widget);
- if (event->window != picker->map_window)
- return FALSE;
+ GtkStyleContext *style = gtk_widget_get_style_context(widget);
- cairo_t *cr = gdk_cairo_create (event->window);
- int width, height;
- gdk_window_get_size (event->window, &width, &height);
+ int width = gtk_widget_get_allocated_width(widget);
+ int height = gtk_widget_get_allocated_height(widget);
if (!picker->map_pixbuf) {
// show alt text if no image was loaded
@@ -537,9 +545,7 @@
}
cleanup:
- cairo_destroy (cr);
- gtk_paint_shadow (widget->style, event->window, GTK_STATE_NORMAL,
- GTK_SHADOW_IN, &event->area, widget, "frame", 0, 0, width, height);
+ gtk_render_frame (style, cr, 0, 0, width, height);
return TRUE;
}
@@ -552,16 +558,15 @@
widget_class->unrealize = ygtk_time_zone_picker_unrealize;
widget_class->map = ygtk_time_zone_picker_map;
widget_class->unmap = ygtk_time_zone_picker_unmap;
- widget_class->expose_event = ygtk_time_zone_picker_expose_event;
- widget_class->size_request = ygtk_time_zone_picker_size_request;
+ widget_class->draw = ygtk_time_zone_picker_draw;
+ widget_class->get_preferred_width = ygtk_time_zone_picker_get_preferred_width;
+ widget_class->get_preferred_height = ygtk_time_zone_picker_get_preferred_height;
widget_class->size_allocate = ygtk_time_zone_picker_size_allocate;
widget_class->button_press_event = ygtk_time_zone_picker_button_press_event;
widget_class->button_release_event = ygtk_time_zone_picker_button_release_event;
widget_class->motion_notify_event = ygtk_time_zone_picker_motion_notify_event;
widget_class->leave_notify_event = ygtk_time_zone_picker_leave_notify_event;
-
- GtkObjectClass *gtkobject_class = GTK_OBJECT_CLASS (klass);
- gtkobject_class->destroy = ygtk_time_zone_picker_destroy;
+ widget_class->destroy = ygtk_time_zone_picker_destroy;
zone_clicked_signal = g_signal_new ("zone_clicked",
G_TYPE_FROM_CLASS (G_OBJECT_CLASS (klass)), G_SIGNAL_RUN_LAST,
Modified: trunk/gtk/src/ygtktimezonepicker.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtktimezonepicker.h?rev…
==============================================================================
--- trunk/gtk/src/ygtktimezonepicker.h (original)
+++ trunk/gtk/src/ygtktimezonepicker.h Sat Jul 23 07:43:30 2011
@@ -10,7 +10,7 @@
#ifndef YGTK_TIME_ZONE_PICKER_H
#define YGTK_TIME_ZONE_PICKER_H
-#include <gtk/gtkwidget.h>
+#include <gtk/gtk.h>
#include <gdk/gdk.h>
G_BEGIN_DECLS
Modified: trunk/gtk/src/ygtktreeview.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtktreeview.c?rev=64969…
==============================================================================
--- trunk/gtk/src/ygtktreeview.c (original)
+++ trunk/gtk/src/ygtktreeview.c Sat Jul 23 07:43:30 2011
@@ -113,27 +113,26 @@
gtk_tree_view_convert_bin_window_to_widget_coords (
view, _popup_x, _popup_y, &_popup_x, &_popup_y);
gint x_orig, y_orig;
- gdk_window_get_origin (widget->window, &x_orig, &y_orig);
+ gdk_window_get_origin (gtk_widget_get_window(widget), &x_orig, &y_orig);
_popup_x += x_orig; _popup_y += y_orig;
g_signal_emit (widget, right_click_signal, 0, outreach);
return TRUE;
}
-static gboolean _ygtk_tree_view_expose_event (GtkWidget *widget, GdkEventExpose *event)
+static gboolean _ygtk_tree_view_draw (GtkWidget *widget, cairo_t *cr)
{
- GTK_WIDGET_CLASS (ygtk_tree_view_parent_class)->expose_event (widget, event);
+ GTK_WIDGET_CLASS (ygtk_tree_view_parent_class)->draw(widget, cr);
GtkTreeView *view = GTK_TREE_VIEW (widget);
YGtkTreeView *yview = YGTK_TREE_VIEW (widget);
- if (yview->empty_text && event->window == gtk_tree_view_get_bin_window (view)) {
+ if (yview->empty_text) {
GtkTreeModel *model = gtk_tree_view_get_model (view);
GtkTreeIter iter;
if (!model || !gtk_tree_model_get_iter_first (model, &iter)) { // empty tree-view
const gchar *text = yview->empty_text;
if (!model)
text = _("Loading...");
- cairo_t *cr = gdk_cairo_create (event->window);
PangoLayout *layout;
layout = gtk_widget_create_pango_layout (widget, text);
@@ -144,14 +143,15 @@
int width, height;
pango_layout_get_pixel_size (layout, &width, &height);
+ GtkAllocation allocation;
+ gtk_widget_get_allocation(widget, &allocation);
int x, y;
- x = (widget->allocation.width - width) / 2;
- y = (widget->allocation.height - height) / 2;
+ x = (allocation.width - width) / 2;
+ y = (allocation.height - height) / 2;
cairo_move_to (cr, x, y);
pango_cairo_show_layout (cr, layout);
g_object_unref (layout);
- cairo_destroy (cr);
}
}
return FALSE;
@@ -291,7 +291,7 @@
GtkWidgetClass *gtkwidget_class = GTK_WIDGET_CLASS (klass);
gtkwidget_class->button_press_event = ygtk_tree_view_button_press_event;
gtkwidget_class->popup_menu = _ygtk_tree_view_popup_menu;
- gtkwidget_class->expose_event = _ygtk_tree_view_expose_event;
+ gtkwidget_class->draw = _ygtk_tree_view_draw;
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = ygtk_tree_view_finalize;
@@ -299,6 +299,6 @@
right_click_signal = g_signal_new ("right-click",
G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (YGtkTreeViewClass, right_click),
- NULL, NULL, gtk_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
+ NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
}
Modified: trunk/gtk/src/ygtktreeview.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtktreeview.h?rev=64969…
==============================================================================
--- trunk/gtk/src/ygtktreeview.h (original)
+++ trunk/gtk/src/ygtktreeview.h Sat Jul 23 07:43:30 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_TREE_VIEW_H
#define YGTK_TREE_VIEW_H
-#include <gtk/gtktreeview.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
#define YGTK_TYPE_TREE_VIEW (ygtk_tree_view_get_type ())
Modified: trunk/gtk/src/ygtkwizard.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkwizard.c?rev=64969&r…
==============================================================================
--- trunk/gtk/src/ygtkwizard.c (original)
+++ trunk/gtk/src/ygtkwizard.c Sat Jul 23 07:43:30 2011
@@ -21,8 +21,6 @@
#define YGI18N_C
#include "YGi18n.h"
-#define HELP_IMG_BG "yelp-icon-big"
-
// YGUtils bridge
extern char *ygutils_mapKBAccel (const char *src);
extern void ygutils_setWidgetFont (GtkWidget *widget, PangoStyle style,
@@ -120,6 +118,7 @@
dialog->help_text = ygtk_html_wrap_new();
gtk_container_add (GTK_CONTAINER (dialog->help_box), dialog->help_text);
+#if 0 // show a nice background image
GtkIconTheme *theme = gtk_icon_theme_get_default();
GtkIconInfo *info = gtk_icon_theme_lookup_icon (theme, HELP_IMG_BG, 192, 0);
if (info) {
@@ -133,6 +132,7 @@
}
gtk_icon_info_free (info);
}
+#endif
// bottom part (search entry + close button)
dialog->search_entry = gtk_entry_new();
@@ -149,7 +149,7 @@
G_CALLBACK (search_entry_activated_cb), dialog);
dialog->close_button = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
- GTK_WIDGET_SET_FLAGS (dialog->close_button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default(dialog->close_button, TRUE);
GtkWidget *close_box = gtk_hbutton_box_new();
gtk_container_add (GTK_CONTAINER (close_box), dialog->close_button);
@@ -237,8 +237,8 @@
NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
GtkBindingSet *binding_set = gtk_binding_set_by_class (klass);
- gtk_binding_entry_add_signal (binding_set, GDK_F3, 0, "find_next", 0);
- gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0, "close", 0);
+ gtk_binding_entry_add_signal (binding_set, GDK_KEY_F3, 0, "find_next", 0);
+ gtk_binding_entry_add_signal (binding_set, GDK_KEY_Escape, 0, "close", 0);
}
#ifdef SET_HELP_HISTORY
@@ -323,7 +323,7 @@
#else
if (help->text)
g_free (help->text);
- help->text = g_strdup (text);
+ help->text = g_strdup (text);
#endif
if (help->dialog)
ygtk_help_text_sync (help, NULL);
@@ -584,7 +584,7 @@
static GtkWidget *button_new (YGtkWizard *wizard)
{
GtkWidget *button = gtk_button_new_with_mnemonic ("");
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default(button, TRUE);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (button_clicked_cb), wizard);
return button;
@@ -647,7 +647,7 @@
GSList *buttons = gtk_size_group_get_widgets (group), *i;
int max_width = 0, total = 0;
for (i = buttons; i; i = i->next) {
- if (!GTK_WIDGET_VISIBLE (i->data))
+ if (!gtk_widget_get_visible (i->data))
continue;
GtkRequisition req;
gtk_widget_get_child_requisition ((GtkWidget *) i->data, &req);
@@ -1201,6 +1201,6 @@
NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
GtkBindingSet *binding_set = gtk_binding_set_by_class (klass);
- gtk_binding_entry_add_signal (binding_set, GDK_F1, 0, "popup_help", 0);
+ gtk_binding_entry_add_signal (binding_set, GDK_KEY_F1, 0, "popup_help", 0);
}
Modified: trunk/gtk/src/ygtkwizard.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkwizard.h?rev=64969&r…
==============================================================================
--- trunk/gtk/src/ygtkwizard.h (original)
+++ trunk/gtk/src/ygtkwizard.h Sat Jul 23 07:43:30 2011
@@ -11,8 +11,8 @@
#define YGTK_WIZARD_H
#include <gdk/gdk.h>
-#include <gtk/gtkwindow.h>
-#include <gtk/gtkvbox.h>
+#include <gtk/gtk.h>
+
G_BEGIN_DECLS
// test feature: history on help dialog
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
22 Jul '11
Author: mvidner
Date: Fri Jul 22 18:09:24 2011
New Revision: 64968
URL: http://svn.opensuse.org/viewcvs/yast?rev=64968&view=rev
Log:
Created tag stable-2_21_0 for network
Added:
tags/stable-2_21_0/network/ (props changed)
- copied from r64967, trunk/network/
--
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] r64967 - in /trunk/network: ./ package/ src/clients/ src/installation/ src/lan/ src/modules/
by mvidner@svn2.opensuse.org 22 Jul '11
by mvidner@svn2.opensuse.org 22 Jul '11
22 Jul '11
Author: mvidner
Date: Fri Jul 22 18:09:02 2011
New Revision: 64967
URL: http://svn.opensuse.org/viewcvs/yast?rev=64967&view=rev
Log:
2.21.0
Merged from SLE11-SP1 and SLE11-SP2:
- Support biosdevname=1 NIC naming scheme: don't write mac-based
udev rules (FATE#311332).
- STARMODE='nfsroot' also for FCoE (FATE#306855).
- Show NIC device names for unconfigured NICs (FATE#311335).
- Fixed configuring multiple interfaces with the same VLAN
(FATE#311380, FATE#309240, bnc#572747, bnc#588588)
- Make the hostname resolvable to our static address coming from
Linuxrc (bnc#664929).
- Do not enable WIRELESS_POWER by default, some APs are broken
(FATE#309255).
svn merge -r63771:HEAD http://svn.opensuse.org/svn/yast/branches/SuSE-Code-11-SP2-Branch/network
Modified:
trunk/network/ (props changed)
trunk/network/VERSION
trunk/network/package/yast2-network.changes
trunk/network/src/clients/save_network.ycp
trunk/network/src/installation/inst_hostname.ycp
trunk/network/src/lan/address.ycp
trunk/network/src/lan/hardware.ycp
trunk/network/src/modules/Host.ycp
trunk/network/src/modules/Lan.ycp
trunk/network/src/modules/LanItems.ycp
trunk/network/src/modules/LanUdevAuto.ycp
trunk/network/yast2-network.spec.in
Modified: trunk/network/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/VERSION?rev=64967&r1=649…
==============================================================================
--- trunk/network/VERSION (original)
+++ trunk/network/VERSION Fri Jul 22 18:09:02 2011
@@ -1 +1 @@
-2.20.13
+2.21.0
Modified: trunk/network/package/yast2-network.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/package/yast2-network.ch…
==============================================================================
--- trunk/network/package/yast2-network.changes (original)
+++ trunk/network/package/yast2-network.changes Fri Jul 22 18:09:02 2011
@@ -1,4 +1,23 @@
-------------------------------------------------------------------
+Fri Jul 22 17:49:47 CEST 2011 - mvidner(a)suse.cz
+
+- Support biosdevname=1 NIC naming scheme: don't write mac-based udev
+ rules (FATE#311332).
+- STARMODE='nfsroot' also for FCoE (FATE#306855).
+- Show NIC device names for unconfigured NICs (FATE#311335).
+- Fixed configuring multiple interfaces with the same VLAN (FATE#311380,
+ FATE#309240, bnc#572747, bnc#588588)
+- Make the hostname resolvable to our static address coming from
+ Linuxrc (bnc#664929).
+- 2.21.0
+
+-------------------------------------------------------------------
+Fri Jul 22 17:49:46 CEST 2011 - jreidinger(a)suse.cz
+
+- Do not enable WIRELESS_POWER by default, some APs are broken
+ (FATE#309255).
+
+-------------------------------------------------------------------
Fri Jul 22 15:48:16 CEST 2011 - locilka(a)suse.cz
- Obsoleted X-KDE-SubstituteUID replaced with xdg-su in Exec in
Modified: trunk/network/src/clients/save_network.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/clients/save_network…
==============================================================================
--- trunk/network/src/clients/save_network.ycp (original)
+++ trunk/network/src/clients/save_network.ycp Fri Jul 22 18:09:02 2011
@@ -223,132 +223,122 @@
list<map> hardware=ReadHardware("netcard");
y2milestone("hardware %1", hardware);
+string StdoutOf(string command) {
+ map out = (map) SCR::Execute (.target.bash_output, command);
+ return out["stdout"]:"";
+}
-
-void CreateIfcfg(){
- string network_configuration="";
+void CreateIfcfg() {
+ string ifcfg="";
if (network_disk==1 && contains(NetworkStorage::getiBFTDevices(), InstallInf["netdevice"]:"")){
- network_configuration = sformat("%1STARTMODE='nfsroot'\nBOOTPROTO='ibft'\n", network_configuration);
- } else {
-
- // set BOOTPROTO=[ static | dhcp ]
- if (InstallInf["bootproto"]:"dhcp"=="static")
- {
- // add broadcast interface #suse49131
- network_configuration=sformat("BOOTPROTO='static'\nIPADDR='%1/%2'\nBROADCAST='%3'\n",
- InstallInf["ipaddr"]:"", Netmask::ToBits(InstallInf["netmask"]:""), InstallInf["bcast"]:"");
- if(size(InstallInf["ipaddr6"]:"")>0){
- network_configuration=sformat("%1\n%2", network_configuration,
- sformat("LABEL_ipv6='ipv6'\nIPADDR_ipv6='%1'\n", InstallInf["ipaddr6"]:"")
- );
- }
- }
- else
- {
- //DHCP (also for IPv6) setup
- if (InstallInf["bootproto"]:""=="dhcp") network_configuration="BOOTPROTO='dhcp4'\n";
- else if (InstallInf["bootproto"]:""=="dhcp6") network_configuration="BOOTPROTO='dhcp6'\n";
- else if (InstallInf["bootproto"]:""=="dhcp,dhcp6") network_configuration="BOOTPROTO='dhcp'\n";
-
- // set DHCP_SET_HOSTNAME=yes #suse30528
- y2milestone("set DHCLIENT_SET_HOSTNAME=yes on installed system");
- SCR::Execute(.target.bash_output, "sed -i s/\"DHCLIENT_SET_HOSTNAME=.*\"/'DHCLIENT_SET_HOSTNAME=\"yes\"'/g /etc/sysconfig/network/dhcp");
- }
-
- switch(network_disk)
- {
- case 0:
- network_configuration = sformat("%1STARTMODE='onboot'\n", network_configuration);
- break;
- case 1:
- if (!contains(NetworkStorage::getiBFTDevices(), InstallInf["netdevice"]:"")){
- network_configuration = sformat("%1STARTMODE='nfsroot'\n", network_configuration);
- }
- break;
- case 3: // FCoE case - create VLAN configuration
- map<string,any> cmd = (map<string,any>) SCR::Execute(.target.bash_output,
- "ls -la /sys/block/*|grep target|grep eth|cut -d'>' -f2|cut -d'/' -f5|uniq");
- y2internal("cmd %1", cmd);
- if (cmd["exit"]:-1==0){
- string ifcfg = splitstring(cmd["stdout"]:"", "\n")[0]:"";
- y2internal("ifcfg: %1", ifcfg);
- string config=sformat("BOOTPROTO=\"static\"\nSTARTMODE=\"nfsroot\"
-ETHERDEVICE=\"%1\"\nUSERCONTROL=\"no\"\n", splitstring(ifcfg, ".")[0]:"");
- y2internal("config: %1", config);
- string config_file=sformat("/etc/sysconfig/network/ifcfg-%1", ifcfg);
- y2internal("filename: %1", config_file);
- SCR::Write(.target.string, config_file, config);
- } else y2error("Command failed.");
- case 2:
- network_configuration = sformat("%1STARTMODE='nfsroot'\n", network_configuration);
- break;
- }
-
- }
-
-
- // wireless devices (bnc#223570)
- if ( size(InstallInf["WESSID"]:"")>0 )
- {
- network_configuration = sformat("%1WIRELESS_ESSID='%2'\n", network_configuration, InstallInf["WESSID"]:"");
-// network_configuration = sformat("%1WIRELESS_AUTH_MODE='%2'\n", network_configuration, InstallInf["WAuth"]:"");
- switch(InstallInf["WAuth"]:""){
- case "" : // "" means wpa-psk
- case "psk" :
- network_configuration = sformat("%1WIRELESS_WPA_PSK='%2'\n", network_configuration, InstallInf["WKey"]:"");
- network_configuration = sformat("%1WIRELESS_AUTH_MODE='psk'\n", network_configuration);
- break;
- case "open" :
- network_configuration = sformat("%1WIRELESS_AUTH_MODE='no-encryption'\n", network_configuration);
- break;
- case "wep_open" :
- case "wep_restricted" :
- string type="";
- if (InstallInf["WkeyType"]:""=="password") type="h:";
- else if (InstallInf["WkeyType"]:""=="ascii") type="s:";
- network_configuration = sformat("%1WIRELESS_AUTH_MODE='%2'\n", network_configuration, (InstallInf["WAuth"]:""=="wep-open") ? "open" : "sharedkey");
- network_configuration = sformat("%1WIRELESS_DEFAULT_KEY='0'\n", network_configuration);
- network_configuration = sformat("%1WIRELESS_KEY_0='%2%3'\n", network_configuration, type, InstallInf["WKey"]:"");
- network_configuration = sformat("%1WIRELESS_KEY_LENGTH='%2'\n", network_configuration, InstallInf["WKeyLen"]:"");
- if (size(InstallInf["WKeyType"]:"")>0 && size(InstallInf["WKey"]:"")>0)
- network_configuration = sformat("%1WIRELESS_KEY_0='%2:%3'\n", network_configuration,
- substring(InstallInf["WKeyType"]:"", 0, 1), InstallInf["WKey"]:"");
- break;
- }
- }
-
-
- // if available, write MTU
- if (size(InstallInf["mtu"]:"")>0)
- network_configuration = sformat("%1MTU='%2'\n", network_configuration, InstallInf["mtu"]:"");
+ ifcfg = sformat("%1STARTMODE='nfsroot'\nBOOTPROTO='ibft'\n", ifcfg);
+ }
+ else {
+ // set BOOTPROTO=[ static | dhcp ]
+ if (InstallInf["bootproto"]:"dhcp"=="static") {
+ // add broadcast interface #suse49131
+ ifcfg=sformat("BOOTPROTO='static'\nIPADDR='%1/%2'\nBROADCAST='%3'\n",
+ InstallInf["ipaddr"]:"", Netmask::ToBits(InstallInf["netmask"]:""), InstallInf["bcast"]:"");
+ if(size(InstallInf["ipaddr6"]:"")>0){
+ ifcfg=sformat("%1\n%2", ifcfg,
+ sformat("LABEL_ipv6='ipv6'\nIPADDR_ipv6='%1'\n", InstallInf["ipaddr6"]:"")
+ );
+ }
+ }
+ else {
+ //DHCP (also for IPv6) setup
+ if (InstallInf["bootproto"]:""=="dhcp") ifcfg="BOOTPROTO='dhcp4'\n";
+ else if (InstallInf["bootproto"]:""=="dhcp6") ifcfg="BOOTPROTO='dhcp6'\n";
+ else if (InstallInf["bootproto"]:""=="dhcp,dhcp6") ifcfg="BOOTPROTO='dhcp'\n";
+
+ // set DHCP_SET_HOSTNAME=yes #suse30528
+ y2milestone("set DHCLIENT_SET_HOSTNAME=yes on installed system");
+ SCR::Execute(.target.bash_output, "sed -i s/\"DHCLIENT_SET_HOSTNAME=.*\"/'DHCLIENT_SET_HOSTNAME=\"yes\"'/g /etc/sysconfig/network/dhcp");
+ }
+
+ if (network_disk == 0) {
+ ifcfg = sformat("%1STARTMODE='onboot'\n", ifcfg);
+ }
+ else if (network_disk > 0) {
+ ifcfg = sformat("%1STARTMODE='nfsroot'\n", ifcfg);
+ }
+ }
- // for queth devices (s390)
- // bnc#578689 - YaST2 should not write the MAC address into ifcfg file
- if ((Arch::s390()) && (size(InstallInf["hwaddr"]:"")>0))
- network_configuration = sformat("%1LLADDR='%2'\n", network_configuration, InstallInf["hwaddr"]:"");
+ // wireless devices (bnc#223570)
+ if ( size(InstallInf["WESSID"]:"")>0 ) {
+ ifcfg = sformat("%1WIRELESS_ESSID='%2'\n", ifcfg, InstallInf["WESSID"]:"");
+
+ switch(InstallInf["WAuth"]:"") {
+ case "" : // "" means wpa-psk
+ case "psk" :
+ ifcfg = sformat("%1WIRELESS_WPA_PSK='%2'\n", ifcfg, InstallInf["WKey"]:"");
+ ifcfg = sformat("%1WIRELESS_AUTH_MODE='psk'\n", ifcfg);
+ break;
+ case "open" :
+ ifcfg = sformat("%1WIRELESS_AUTH_MODE='no-encryption'\n", ifcfg);
+ break;
+ case "wep_open" :
+ case "wep_restricted" :
+ string type="";
+ if (InstallInf["WkeyType"]:""=="password") type="h:";
+ else if (InstallInf["WkeyType"]:""=="ascii") type="s:";
+ ifcfg = sformat("%1WIRELESS_AUTH_MODE='%2'\n", ifcfg, (InstallInf["WAuth"]:""=="wep-open") ? "open" : "sharedkey");
+ ifcfg = sformat("%1WIRELESS_DEFAULT_KEY='0'\n", ifcfg);
+ ifcfg = sformat("%1WIRELESS_KEY_0='%2%3'\n", ifcfg, type, InstallInf["WKey"]:"");
+ ifcfg = sformat("%1WIRELESS_KEY_LENGTH='%2'\n", ifcfg, InstallInf["WKeyLen"]:"");
+ if (size(InstallInf["WKeyType"]:"")>0 && size(InstallInf["WKey"]:"")>0) {
+ ifcfg = sformat("%1WIRELESS_KEY_0='%2:%3'\n", ifcfg,
+ substring(InstallInf["WKeyType"]:"", 0, 1), InstallInf["WKey"]:"");
+ }
+ break;
+ }
+ }
+ // if available, write MTU
+ if (size(InstallInf["mtu"]:"")>0) {
+ ifcfg = sformat("%1MTU='%2'\n", ifcfg, InstallInf["mtu"]:"");
+ }
+ // for queth devices (s390)
+ // bnc#578689 - YaST2 should not write the MAC address into ifcfg file
+ if ((Arch::s390()) && (size(InstallInf["hwaddr"]:"")>0)) {
+ ifcfg = sformat("%1LLADDR='%2'\n", ifcfg, InstallInf["hwaddr"]:"");
+ }
// point to point interface
- if (size(InstallInf["remote_ip"]:"")>0)
- network_configuration = sformat("%1REMOTE_IPADDR='%2'\n", network_configuration, InstallInf["remote_ip"]:"");
+ if (size(InstallInf["remote_ip"]:"")>0) {
+ ifcfg = sformat("%1REMOTE_IPADDR='%2'\n", ifcfg, InstallInf["remote_ip"]:"");
+ }
- string ifcfg = sformat("ifcfg-%1", netdevice);
+ string new_netdevice = netdevice;
+ if (! LanUdevAuto::AllowUdevModify()) {
+ string cmd = sformat("biosdevname --policy=all_names -i %1", netdevice);
+ string out = String::FirstChunk(StdoutOf(cmd), "\n");
+ if (out != "") {
+ y2milestone ("biosdevname renames %1 to %2", netdevice, out);
+ new_netdevice = out;
+ }
+ }
+
+ string ifcfg_name = sformat("ifcfg-%1", new_netdevice);
- string hw_name = BuildDescription(NetworkInterfaces::device_type(netdevice), NetworkInterfaces::device_num(ifcfg), $["dev_name":netdevice], hardware);
+ string hw_name = BuildDescription(NetworkInterfaces::device_type(netdevice),
+ NetworkInterfaces::device_num(ifcfg_name),
+ $["dev_name":netdevice],
+ hardware);
// protect special characters, #305343
- if (size(hw_name)>0)
- network_configuration = sformat("%1NAME='%2'\n", network_configuration, String::Quote (hw_name));
+ if (size(hw_name)>0) {
+ ifcfg = sformat("%1NAME='%2'\n", ifcfg, String::Quote (hw_name));
+ }
- y2milestone("Network Configuration:\n%1\nifcfg file: %2", network_configuration, ifcfg);
+ y2milestone("Network Configuration:\n%1\nifcfg file: %2", ifcfg, ifcfg_name);
// write only if file doesn't exists
- string dev_file=sformat("/etc/sysconfig/network/%1", ifcfg);
- // string dev_file=sformat("/tmp/%1", ifcfg);
+ string dev_file=sformat("/etc/sysconfig/network/%1", ifcfg_name);
- SCR::Write(.target.string, dev_file, network_configuration);
- y2milestone("ifcfg file: %1", dev_file);
+ SCR::Write(.target.string, dev_file, ifcfg);
+ y2milestone("ifcfg file: %1", dev_file);
}
/*
Modified: trunk/network/src/installation/inst_hostname.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/installation/inst_ho…
==============================================================================
--- trunk/network/src/installation/inst_hostname.ycp (original)
+++ trunk/network/src/installation/inst_hostname.ycp Fri Jul 22 18:09:02 2011
@@ -14,6 +14,7 @@
import "Arch";
import "DNS";
import "GetInstArgs";
+import "Host";
import "NetworkConfig";
import "String";
import "Wizard";
@@ -57,6 +58,10 @@
if (ret == `next)
{
+ Host::Read();
+ Host::ResolveHostnameToStaticIPs();
+ Host::Write();
+
// do not let Lan override us, #152218
DNS::proposal_valid = true;
Modified: trunk/network/src/lan/address.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/lan/address.ycp?rev=…
==============================================================================
--- trunk/network/src/lan/address.ycp (original)
+++ trunk/network/src/lan/address.ycp Fri Jul 22 18:09:02 2011
@@ -125,9 +125,6 @@
*/
void InitVLANSlave(string key)
{
- settings["ETHERDEVICE"] = NetworkInterfaces::Current["ETHERDEVICE"]:"";
- settings["VLAN_ID"] = tointeger(NetworkInterfaces::Current["VLAN_ID"]:"0");
-
list items = [];
// unconfigured devices
foreach(integer i, map a, (map<integer, map>)LanItems::Items,{
@@ -150,16 +147,10 @@
symbol HandleVLANSlave(string key, map event){
- if (event["EventReason"]:""=="ValueChanged"){
- string configname = sformat("%1.%2", UI::QueryWidget(`id(`vlan_eth), `Value), UI::QueryWidget(`id(`vlan_id), `Value));
- NetworkInterfaces::Name = configname;
- LanItems::Items[LanItems::current, "ifcfg"]= configname;
- UI::ChangeWidget(`id("IFCFGID"), `Value, configname);
- }
- return nil;
+ // formerly tried to edit ifcfg name. bad idea, surrounding code not ready
+ return nil;
}
-
/**
* Default function to store the value of ETHERDEVICE devices box.
* @param key id of the widget
@@ -945,6 +936,11 @@
// TODO: dynamic for dummy. or add dummy from outside?
boolean no_dhcp = is_ptp || settings["IFCFGTYPE"]:"" == "dummy" || LanItems::alias != "";
+ if (LanItems::type == "vlan") {
+ settings["ETHERDEVICE"] = LanItems::vlan_etherdevice;
+ settings["VLAN_ID"] = tointeger(LanItems::vlan_id);
+ }
+
if (contains(["tun", "tap"], LanItems::type))
{
settings = $[
@@ -1233,7 +1229,10 @@
// address tab
if(LanItems::operation == `add) {
LanItems::device = NetworkInterfaces::device_num(ifcfgname);
- LanItems::type = NetworkInterfaces::device_type(ifcfgname);
+ LanItems::type = NetworkInterfaces::GetTypeFromIfcfg(settings);
+ if (LanItems::type == nil) {
+ LanItems::type = NetworkInterfaces::device_type(ifcfgname);
+ }
}
LanItems::bootproto = settings["BOOTPROTO"]:"";
@@ -1277,9 +1276,7 @@
if (LanItems::type == "vlan"){
LanItems::vlan_etherdevice = settings["ETHERDEVICE"]:"";
-y2internal("%1, %2", LanItems::vlan_id, (integer)settings["VLAN_ID"]:0);
LanItems::vlan_id = tostring((integer)settings["VLAN_ID"]:0);
-y2internal("%1", LanItems::vlan_id);
} else if (LanItems::type == "br"){
LanItems::bridge_ports = settings["BRIDGE_PORTS"]:"";
} else if (contains(["tun", "tap"], LanItems::type)){
Modified: trunk/network/src/lan/hardware.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/lan/hardware.ycp?rev…
==============================================================================
--- trunk/network/src/lan/hardware.ycp (original)
+++ trunk/network/src/lan/hardware.ycp Fri Jul 22 18:09:02 2011
@@ -531,10 +531,9 @@
LanItems::startmode="auto";
}
if (LanItems::type=="vlan"){
- string vlanid=(string) UI::QueryWidget(`id(`num), `Value);
- NetworkInterfaces::Current["VLAN_ID"] = vlanid;
+ LanItems::vlan_id = (string) UI::QueryWidget(`id(`num), `Value);
}
- }
+}
string driver = (string) UI::QueryWidget(`modul, `Value);
LanItems::setDriver(driver);
Modified: trunk/network/src/modules/Host.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/modules/Host.ycp?rev…
==============================================================================
--- trunk/network/src/modules/Host.ycp (original)
+++ trunk/network/src/modules/Host.ycp Fri Jul 22 18:09:02 2011
@@ -303,6 +303,27 @@
return summary;
}
+list<string> StaticIPs() {
+ NetworkInterfaces::Read ();
+ list<string> devs = NetworkInterfaces::Locate ("BOOTPROTO", "static");
+ devs = filter(string dev, devs, { return dev != "lo"; });
+ list<string> ips = maplist(string dev, devs, {
+ return NetworkInterfaces::GetValue(dev, "IPADDR");
+ });
+ y2milestone("ifcfgs: %1 IPs: %2", devs, ips);
+ return ips;
+}
+
+// if we have a static address,
+// make sure /etc/hosts resolves it to our, bnc#664929
+global void ResolveHostnameToStaticIPs() {
+ list<string> static_ips = StaticIPs();
+ if (size(static_ips) > 0) {// excluding lo
+ string fqhostname = Hostname::MergeFQ( DNS::hostname, DNS::domain);
+ Update(fqhostname, fqhostname, static_ips);
+ }
+}
+
/**
* Function which returns if the settings were modified
* @return boolean settings were modified
Modified: trunk/network/src/modules/Lan.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/modules/Lan.ycp?rev=…
==============================================================================
--- trunk/network/src/modules/Lan.ycp (original)
+++ trunk/network/src/modules/Lan.ycp Fri Jul 22 18:09:02 2011
@@ -431,8 +431,9 @@
if(Abort()) return false;
/* Progress step 3 - multiple devices may be present, really plural*/
ProgressNextStage(_("Writing device configuration..."));
- if (!Mode::autoinst())
+ if (!Mode::autoinst() && LanUdevAuto::AllowUdevModify()) {
LanItems::WriteUdevDriverRules();
+ }
NetworkInterfaces::Write("netcard");
// WriteDevices();
sleep(sl);
Modified: trunk/network/src/modules/LanItems.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/modules/LanItems.ycp…
==============================================================================
--- trunk/network/src/modules/LanItems.ycp (original)
+++ trunk/network/src/modules/LanItems.ycp Fri Jul 22 18:09:02 2011
@@ -473,119 +473,139 @@
list<string> overview=[];
list<string> links=[];
map startmode_descrs = $[
- // summary description of STARTMODE=auto
- "auto": _("Started automatically at boot"),
- // summary description of STARTMODE=auto
- "onboot": _("Started automatically at boot"),
- // summary description of STARTMODE=hotplug
- "hotplug": _("Started automatically at boot"),
- // summary description of STARTMODE=ifplugd
- "ifplugd": _("Started automatically on cable connection"),
- // summary description of STARTMODE=managed
- "managed": _("Managed by NetworkManager"),
- // summary description of STARTMODE=off
- "off" : _("Will not be started at all")
- ];
-
-
- foreach(integer key, (list<integer>)Map::Keys(Items), {
- string rich = "";
- string ip = _("Not configured");
- string descr = Items[key, "hwinfo", "name"]:"";
- type = Items[key, "hwinfo", "type"]:"";
- descr = CheckEmptyName (type, descr);
- list <string> bullets = [];
-
- if (hasAnyValue(Items[key, "ifcfg"]:"") ){
- NetworkInterfaces::Select(Items[key, "ifcfg"]:"");
- if (!hasAnyValue(type)) type = NetworkInterfaces::GetType(Items[key, "ifcfg"]:"");
- descr = BuildDescription(type, NetworkInterfaces::GetType(Items[key, "ifcfg"]:""), NetworkInterfaces::Current, [Items[key, "hwinfo"]:$[]]);
- string dev = NetworkInterfaces::Name; //NetworkInterfaces::device_name(type, NetworkInterfaces::Name);
- ip = DeviceProtocol(NetworkInterfaces::Current);
- string status = DeviceStatus(type, NetworkInterfaces::device_num(NetworkInterfaces::Name), NetworkInterfaces::Current);
-
-
- string startmode_descr = startmode_descrs[NetworkInterfaces::Current["STARTMODE"]:""]:_("Started manually");
-
- bullets = [
- sformat(_("Device Name: %1"), dev),
- startmode_descr,
- ];
- if (NetworkInterfaces::Current["STARTMODE"]:"" != "managed")
- {
- if (ip != "NONE")
- {
- string prefixlen = NetworkInterfaces::Current["PREFIXLEN"]:"";
- if (size(ip)>0){
- string descr = sformat("%1 %2", _("IP address assigned using"), ip);
- if (!issubstring(ip, "DHCP")) descr=(size(prefixlen)>0) ?
+ // summary description of STARTMODE=auto
+ "auto": _("Started automatically at boot"),
+ // summary description of STARTMODE=auto
+ "onboot": _("Started automatically at boot"),
+ // summary description of STARTMODE=hotplug
+ "hotplug": _("Started automatically at boot"),
+ // summary description of STARTMODE=ifplugd
+ "ifplugd": _("Started automatically on cable connection"),
+ // summary description of STARTMODE=managed
+ "managed": _("Managed by NetworkManager"),
+ // summary description of STARTMODE=off
+ "off" : _("Will not be started at all")
+ ];
+
+ foreach(integer key, (list<integer>)Map::Keys(Items), {
+ string rich = "";
+ string ip = _("Not configured");
+ string descr = Items[key, "hwinfo", "name"]:"";
+ type = Items[key, "hwinfo", "type"]:"";
+ descr = CheckEmptyName (type, descr);
+ list <string> bullets = [];
+
+ if (hasAnyValue(Items[key, "ifcfg"]:"") ){
+ NetworkInterfaces::Select(Items[key, "ifcfg"]:"");
+ if (!hasAnyValue(type)) type = NetworkInterfaces::GetType(Items[key, "ifcfg"]:"");
+ descr = BuildDescription(type, NetworkInterfaces::GetType(Items[key, "ifcfg"]:""), NetworkInterfaces::Current, [Items[key, "hwinfo"]:$[]]);
+ string dev = NetworkInterfaces::Name; //NetworkInterfaces::device_name(type, NetworkInterfaces::Name);
+ ip = DeviceProtocol(NetworkInterfaces::Current);
+ string status = DeviceStatus(type, NetworkInterfaces::device_num(NetworkInterfaces::Name), NetworkInterfaces::Current);
+
+ string startmode_descr = startmode_descrs[NetworkInterfaces::Current["STARTMODE"]:""]:_("Started manually");
+
+ bullets = [
+ sformat(_("Device Name: %1"), dev),
+ startmode_descr,
+ ];
+
+ if (NetworkInterfaces::Current["STARTMODE"]:"" != "managed") {
+ if (ip != "NONE") {
+ string prefixlen = NetworkInterfaces::Current["PREFIXLEN"]:"";
+ if (size(ip)>0) {
+ string descr = sformat("%1 %2", _("IP address assigned using"), ip);
+ if (!issubstring(ip, "DHCP"))
+ descr=(size(prefixlen)>0) ?
sformat(_("IP address: %1/%2"), ip, prefixlen) :
sformat(_("IP address: %1, subnet mask %2")
- , ip, NetworkInterfaces::Current["NETMASK"]:"");
- bullets = bullets + [ descr ];
- }
- }
- // build aliases overview
- if (size(NetworkInterfaces::Current["_aliases"]:$[])>0 && !NetworkService::IsManaged()){
- foreach(string key, map<string, any> desc, (map<string ,map<string, any> >) NetworkInterfaces::Current["_aliases"]:$[], {
- string parameters = sformat("%1/%2", desc["IPADDR"]:"", desc["PREFIXLEN"]:"");
- bullets = add(bullets, sformat("%1 (%2)", desc["LABEL"]:"", parameters) );
- });
- }
- }
-
- if (type == "wlan" &&
- !(NetworkInterfaces::Current["WIRELESS_AUTH_MODE"]:"" != "open") &&
- !hasAnyValue(NetworkInterfaces::Current["WIRELESS_KEY_0"]:""))
- {
- // avoid colons
- dev = mergestring (splitstring (dev, ":"), "/");
- string href = "lan--wifi-encryption-" + dev;
- // interface summary: WiFi without encryption
- string warning = HTML::Colorize (_("Warning: no encryption is used."), "red");
- status = status + " " + warning + " " +
- // Hyperlink: Change the configuration of an interface
- Hyperlink (href, _("Change."));
- links = add (links, href);
- }
-
- overview = add(overview, Summary::Device(descr, status));
- } else
- overview = add(overview, Summary::Device(descr, Summary::NotConfigured()));
-
- string conn = HTML::Bold ( (Items[key, "hwinfo", "link"]:false == true)?"":sformat("(%1)", _("Not connected") ));
-
- if (size(Items[key, "hwinfo"]:$[])==0) conn = HTML::Bold(sformat("(%1)", _("No hwinfo")));
- string mac_dev = HTML::Bold ("MAC : ") + Items[key, "hwinfo", "mac"]:"" + "<br>";
- string bus_id = HTML::Bold ("BusID : ") + Items[key, "hwinfo", "busid"]:"" + "<br>";
- if (hasAnyValue(Items[key, "hwinfo", "mac"]:"")) rich = " " + conn + "<br>" + mac_dev;
- if (hasAnyValue(Items[key, "hwinfo", "busid"]:"")) rich = rich + bus_id;
- rich = HTML::Bold ( descr ) + rich;
-
- if (!hasAnyValue(Items[key, "hwinfo", "dev_name"]:"") && size(Items[key, "hwinfo"]:$[])>0 && !Arch::s390())
- rich = rich + _("<p>Unable to configure the network card because the kernel device (eth0, wlan0) is not present. This is mostly caused by missing firmware (for wlan devices). See dmesg output for details.</p>");
- else if (hasAnyValue(Items[key, "ifcfg"]:"") ) rich = rich + HTML::List (bullets);
- else {
- rich = rich + _("<p>The device is not configured. Press <b>Edit</b>
+ , ip, NetworkInterfaces::Current["NETMASK"]:"");
+ bullets = bullets + [ descr ];
+ }
+ }
+ // build aliases overview
+ if (size(NetworkInterfaces::Current["_aliases"]:$[])>0 && !NetworkService::IsManaged()){
+ foreach(string key, map<string, any> desc, (map<string ,map<string, any> >) NetworkInterfaces::Current["_aliases"]:$[], {
+ string parameters = sformat("%1/%2", desc["IPADDR"]:"", desc["PREFIXLEN"]:"");
+ bullets = add(bullets, sformat("%1 (%2)", desc["LABEL"]:"", parameters) );
+ });
+ }
+ }
+
+ if (type == "wlan" &&
+ !(NetworkInterfaces::Current["WIRELESS_AUTH_MODE"]:"" != "open") &&
+ !hasAnyValue(NetworkInterfaces::Current["WIRELESS_KEY_0"]:"")) {
+ // avoid colons
+ dev = mergestring (splitstring (dev, ":"), "/");
+ string href = "lan--wifi-encryption-" + dev;
+ // interface summary: WiFi without encryption
+ string warning = HTML::Colorize (_("Warning: no encryption is used."), "red");
+ status = status + " " + warning + " " +
+ // Hyperlink: Change the configuration of an interface
+ Hyperlink (href, _("Change."));
+ links = add (links, href);
+ }
+
+ overview = add(overview, Summary::Device(descr, status));
+ }
+ else {
+ overview = add(overview, Summary::Device(descr, Summary::NotConfigured()));
+ }
+
+ string conn = HTML::Bold ( (Items[key, "hwinfo", "link"]:false == true)?"":sformat("(%1)", _("Not connected") ));
+
+ if (size(Items[key, "hwinfo"]:$[])==0) {
+ conn = HTML::Bold(sformat("(%1)", _("No hwinfo")));
+ }
+
+ string mac_dev = HTML::Bold ("MAC : ") + Items[key, "hwinfo", "mac"]:"" + "<br>";
+ string bus_id = HTML::Bold ("BusID : ") + Items[key, "hwinfo", "busid"]:"" + "<br>";
+
+ if (hasAnyValue(Items[key, "hwinfo", "mac"]:"")) {
+ rich = rich + " " + conn + "<br>";
+ rich = rich + mac_dev;
+ }
+ if (hasAnyValue(Items[key, "hwinfo", "busid"]:"")) {
+ rich = rich + bus_id;
+ }
+ // display it only if we need it, don't duplicate "dev" above
+ if (hasAnyValue(Items[key, "hwinfo", "dev_name"]:"") &&
+ ! hasAnyValue(Items[key, "ifcfg"]:"")) {
+ string dev_name = sformat(_("Device Name: %1"), Items[key, "hwinfo", "dev_name"]:"" );
+ string dev_name_r = HTML::Bold(dev_name) + "<br>";
+ rich = rich + dev_name_r;
+ }
+
+ rich = HTML::Bold ( descr ) + rich;
+
+ if (!hasAnyValue(Items[key, "hwinfo", "dev_name"]:"") && size(Items[key, "hwinfo"]:$[])>0 && !Arch::s390()) {
+ rich = rich + _("<p>Unable to configure the network card because the kernel device (eth0, wlan0) is not present. This is mostly caused by missing firmware (for wlan devices). See dmesg output for details.</p>");
+ }
+ else if (hasAnyValue(Items[key, "ifcfg"]:"") ) {
+ rich = rich + HTML::List (bullets);
+ }
+ else {
+ rich = rich + _("<p>The device is not configured. Press <b>Edit</b>
to configure.</p>
");
- integer curr=current;
- current=key;
- if(needFirmwareCurrentItem()){
- string fw = GetFirmwareForCurrentItem();
- rich = rich+ sformat("%1 : %2",
- _("Needed firmware"), (fw!="") ? fw : _("unknown"));
- }
- current=curr;
- }
-
- Items[key, "table_descr"] = $[
- "rich_descr" : rich,
- "table_descr": [descr, ip]
- ];
- });
- return [ Summary::DevicesList(overview), links ];
+ integer curr = current;
+ current = key;
+ if (needFirmwareCurrentItem()) {
+ string fw = GetFirmwareForCurrentItem();
+ rich = rich+ sformat("%1 : %2",
+ _("Needed firmware"),
+ (fw!="") ? fw : _("unknown"));
+ }
+ current=curr;
+ }
+
+ Items[key, "table_descr"] = $[
+ "rich_descr" : rich,
+ "table_descr": [descr, ip]
+ ];
+ });
+ return [ Summary::DevicesList(overview), links ];
}
@@ -833,7 +853,8 @@
usercontrol = GetDeviceVar (devmap, defaults, "USERCONTROL") == "yes";
description = GetDeviceVar (devmap, defaults, "NAME");
bond_option = GetDeviceVar(devmap, defaults, "BONDING_MODULE_OPTS");
- vlan_id = GetDeviceVar(devmap, defaults, "VLAN_ID");
+ vlan_etherdevice = GetDeviceVar(devmap, defaults, "ETHERDEVICE");
+ vlan_id = GetDeviceVar(devmap, defaults, "VLAN_ID"); // FIXME, remember that it can be implied from the name. probably
bond_slaves=[];
foreach(any key, any value, devmap,
@@ -927,7 +948,7 @@
"WIRELESS_FREQUENCY": "",
"WIRELESS_BITRATE": "auto",
"WIRELESS_AP": "",
- "WIRELESS_POWER": "yes",
+ "WIRELESS_POWER": "",
"PORTNAME": "",
// aliases = devmap["_aliases"]:$[]; // ?
"WIRELESS_EAP_MODE": "",
@@ -1063,11 +1084,6 @@
newdev["BOOTPROTO"] = bootproto;
}
newdev["NAME"] = description;
- // L3: bnc#585458
-// if (!issubstring(Items[current, "ifcfg"]:"", type)) newdev["INTERFACETYPE"]=type;
- // exception for VLAN
- // because of ethX.Y
-// if (deletechars(Items[current, "ifcfg"]:"", "0123456789")!=type && type!="vlan") newdev["INTERFACETYPE"]=type;
if(hotplug == "pcmcia") newdev["DHCLIENT_SET_DOWN_LINK"] = "yes";
@@ -1161,6 +1177,14 @@
"TUNNEL_SET_GROUP" : tunnel_set_group
];
}
+
+ // L3: bnc#585458
+ // FIXME: INTERFACETYPE confuses sysconfig, bnc#458412
+ // Only test when newdev has enough info for GetTypeFromIfcfg to work.
+ if (NetworkInterfaces::GetTypeFromIfcfg(newdev) != type) {
+ newdev["INTERFACETYPE"]=type;
+ }
+
NetworkInterfaces::Name = Items[current, "ifcfg"]:"";
NetworkInterfaces::Current = newdev;
y2internal("%1", newdev);
Modified: trunk/network/src/modules/LanUdevAuto.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/modules/LanUdevAuto.…
==============================================================================
--- trunk/network/src/modules/LanUdevAuto.ycp (original)
+++ trunk/network/src/modules/LanUdevAuto.ycp Fri Jul 22 18:09:02 2011
@@ -12,6 +12,7 @@
{
module "LanUdevAuto";
import "LanItems";
+ import "Map";
include "network/routines.ycp";
textdomain "network";
@@ -20,6 +21,42 @@
list<map> s390_devices=[];
list <map> hardware=nil;
+/**
+ * @return parameter from /etc/install.inf or nil
+ * @param name parameter name, case sensitive
+ */
+string InstallInfParameter(string name) {
+ path p = add(.etc.install_inf, name);
+ return (string) SCR::Read(p);
+}
+
+/**
+ * @return parameter from the kernel(boot) command line or nil
+ * @param name parameter name, case sensitive
+ */
+string KernelCmdlineParameter(string name) {
+ string cmdline = InstallInfParameter("Cmdline");
+ map cmdmap = Map::FromString(cmdline); // handles nil too
+ return (string) cmdmap[name]:nil;
+}
+
+/**
+ * @return installation parameter or nil
+ * @param name parameter name, case sensitive
+ */
+string InstallationParameter(string name) {
+ string value = InstallInfParameter(name);
+ if (value == nil) {
+ value = KernelCmdlineParameter(name);
+ }
+ return value;
+}
+
+// FATE#311332
+global boolean AllowUdevModify() {
+ return InstallationParameter("biosdevname") != "1";
+}
+
global string getDeviceName(string oldname){
string newname=oldname;
if (hardware==nil) hardware=ReadHardware("netcard");
@@ -117,8 +154,10 @@
});
if (size(rules)>0){
y2milestone("Writing AY udev rules for network (will replace original rules from 1st stage)");
- SCR::Write(.udev_persistent.rules_comment, comment);
- SCR::Write(.udev_persistent.rules, rules);
+ if (AllowUdevModify()){
+ SCR::Write(.udev_persistent.rules_comment, comment);
+ SCR::Write(.udev_persistent.rules, rules);
+ }
} else
y2milestone("No udev rules defined by AY, nothing to write (keep original file)");
if (Arch::s390()){
Modified: trunk/network/yast2-network.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/yast2-network.spec.in?re…
==============================================================================
--- trunk/network/yast2-network.spec.in (original)
+++ trunk/network/yast2-network.spec.in Fri Jul 22 18:09:02 2011
@@ -10,9 +10,10 @@
BuildRequires: yast2-country
BuildRequires: yast2-installation >= 2.15.27
-# NetworkStorage: adapt functions needed for iBFT (bnc#551380)
-BuildRequires: yast2 >= 2.19.3
-Requires: yast2 >= 2.19.3
+# NetworkInterfaces::GetTypeFromIfcfg (bnc#572747)
+BuildRequires: yast2 >= 2.21.6
+Requires: yast2 >= 2.21.6
+
#netconfig (FaTE #303618)
Requires: sysconfig >= 0.71.2
#GetLanguageCountry
--
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] r64966 - in /trunk/heartbeat: package/yast2-heartbeat.changes src/heartbeat.desktop
by locilka@svn2.opensuse.org 22 Jul '11
by locilka@svn2.opensuse.org 22 Jul '11
22 Jul '11
Author: locilka
Date: Fri Jul 22 17:06:30 2011
New Revision: 64966
URL: http://svn.opensuse.org/viewcvs/yast?rev=64966&view=rev
Log:
Using xdg-su in the Exec entry in desktop file
Modified:
trunk/heartbeat/package/yast2-heartbeat.changes
trunk/heartbeat/src/heartbeat.desktop
Modified: trunk/heartbeat/package/yast2-heartbeat.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/heartbeat/package/yast2-heartbea…
==============================================================================
--- trunk/heartbeat/package/yast2-heartbeat.changes (original)
+++ trunk/heartbeat/package/yast2-heartbeat.changes Fri Jul 22 17:06:30 2011
@@ -2,7 +2,7 @@
Fri Jul 22 15:25:31 CEST 2011 - locilka(a)suse.cz
- Removed obsoleted X-KDE-SubstituteUID from desktop file
- (bnc#540627)
+ (bnc#540627) and replaced with xdg-su call in the Exec entry.
-------------------------------------------------------------------
Wed Sep 17 16:34:45 CEST 2008 - kmachalkova(a)suse.cz
Modified: trunk/heartbeat/src/heartbeat.desktop
URL: http://svn.opensuse.org/viewcvs/yast/trunk/heartbeat/src/heartbeat.desktop?…
==============================================================================
--- trunk/heartbeat/src/heartbeat.desktop (original)
+++ trunk/heartbeat/src/heartbeat.desktop Fri Jul 22 17:06:30 2011
@@ -17,7 +17,7 @@
X-SuSE-YaST-AutoInstResource=heartbeat
Icon=yast-heartbeat
-Exec=/sbin/yast2 heartbeat
+Exec=/usr/bin/xdg-su -c '/sbin/yast2 heartbeat'
Name=High Availability
GenericName=Configure high availability (heartbeat)
--
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] r64965 - in /trunk/you-server: package/yast2-you-server.changes src/you_server.desktop
by locilka@svn2.opensuse.org 22 Jul '11
by locilka@svn2.opensuse.org 22 Jul '11
22 Jul '11
Author: locilka
Date: Fri Jul 22 17:04:55 2011
New Revision: 64965
URL: http://svn.opensuse.org/viewcvs/yast?rev=64965&view=rev
Log:
Using xdg-su in the Exec entry of desktop file
Modified:
trunk/you-server/package/yast2-you-server.changes
trunk/you-server/src/you_server.desktop
Modified: trunk/you-server/package/yast2-you-server.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/you-server/package/yast2-you-ser…
==============================================================================
--- trunk/you-server/package/yast2-you-server.changes (original)
+++ trunk/you-server/package/yast2-you-server.changes Fri Jul 22 17:04:55 2011
@@ -2,7 +2,7 @@
Fri Jul 22 15:24:34 CEST 2011 - locilka(a)suse.cz
- Removed obsoleted X-KDE-SubstituteUID from desktop file
- (bnc#540627)
+ (bnc#540627) and replaced with xdg-su call in the Exec entry.
-------------------------------------------------------------------
Fri May 16 16:40:22 CEST 2008 - jsrain(a)suse.cz
Modified: trunk/you-server/src/you_server.desktop
URL: http://svn.opensuse.org/viewcvs/yast/trunk/you-server/src/you_server.deskto…
==============================================================================
--- trunk/you-server/src/you_server.desktop (original)
+++ trunk/you-server/src/you_server.desktop Fri Jul 22 17:04:55 2011
@@ -17,7 +17,7 @@
X-SuSE-YaST-AutoInstResource=
Icon=yast-you_server
-Exec=/sbin/yast2 you_server
+Exec=/usr/bin/xdg-su -c '/sbin/yast2 you_server'
Name=YOU Server Configuration
GenericName=Set up a local server for serving YaST Online Update clients
--
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] r64964 - /trunk/doc/tutorials/tutorial-includes/sshd/t1-start-sshd.desktop
by locilka@svn2.opensuse.org 22 Jul '11
by locilka@svn2.opensuse.org 22 Jul '11
22 Jul '11
Author: locilka
Date: Fri Jul 22 17:02:58 2011
New Revision: 64964
URL: http://svn.opensuse.org/viewcvs/yast?rev=64964&view=rev
Log:
SSHD tutorial following the current way of calling YaST Module using
desktop file
Modified:
trunk/doc/tutorials/tutorial-includes/sshd/t1-start-sshd.desktop
Modified: trunk/doc/tutorials/tutorial-includes/sshd/t1-start-sshd.desktop
URL: http://svn.opensuse.org/viewcvs/yast/trunk/doc/tutorials/tutorial-includes/…
==============================================================================
--- trunk/doc/tutorials/tutorial-includes/sshd/t1-start-sshd.desktop (original)
+++ trunk/doc/tutorials/tutorial-includes/sshd/t1-start-sshd.desktop Fri Jul 22 17:02:58 2011
@@ -6,7 +6,7 @@
X-SuSE-YaST-Group=Misc
...
Icon=yast-sshd
-<command>Exec=/sbin/yast2 sshd</command>
+<command>Exec=/usr/bin/xdg-su -c '/sbin/yast2 sshd'</command>
...
<command>Name=Sshd</command>
GenericName=sshd
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0