[PATCH] Call finalize functions in parent classes.
by David Shea
According to the GObject docs, implementations of constructor(),
dispose() and finalize() each need to chain up to the parent class. This
does so for the places we override finalize().
---
widgets/src/DiskOverview.c | 9 ++++++---
widgets/src/MountpointSelector.c | 9 ++++++---
widgets/src/SpokeSelector.c | 9 ++++++---
3 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/widgets/src/DiskOverview.c b/widgets/src/DiskOverview.c
index 9e42540..5fc249e 100644
--- a/widgets/src/DiskOverview.c
+++ b/widgets/src/DiskOverview.c
@@ -81,7 +81,7 @@ static void anaconda_disk_overview_set_property(GObject *object, guint prop_id,
static void anaconda_disk_overview_toggle_background(AnacondaDiskOverview *widget);
static void anaconda_disk_overview_realize(GtkWidget *widget, gpointer user_data);
-static void anaconda_disk_overview_finalize(AnacondaDiskOverview *widget);
+static void anaconda_disk_overview_finalize(GObject *object);
static gboolean anaconda_disk_overview_focus_changed(GtkWidget *widget, GdkEventFocus *event, gpointer user_data);
@@ -90,7 +90,7 @@ static void anaconda_disk_overview_class_init(AnacondaDiskOverviewClass *klass)
object_class->set_property = anaconda_disk_overview_set_property;
object_class->get_property = anaconda_disk_overview_get_property;
- object_class->finalize = (GObjectFinalizeFunc) anaconda_disk_overview_finalize;
+ object_class->finalize = anaconda_disk_overview_finalize;
/**
* AnacondaDiskOverview:kind:
@@ -349,8 +349,11 @@ static void anaconda_disk_overview_toggle_background(AnacondaDiskOverview *widge
gtk_widget_show(widget->priv->kind_icon);
}
-static void anaconda_disk_overview_finalize(AnacondaDiskOverview *widget) {
+static void anaconda_disk_overview_finalize(GObject *object) {
+ AnacondaDiskOverview *widget = ANACONDA_DISK_OVERVIEW(object);
g_object_unref(widget->priv->cursor);
+
+ G_OBJECT_CLASS(anaconda_disk_overview_parent_class)->finalize(object);
}
static void anaconda_disk_overview_realize(GtkWidget *widget, gpointer user_data) {
diff --git a/widgets/src/MountpointSelector.c b/widgets/src/MountpointSelector.c
index 3b2573a..730f107 100644
--- a/widgets/src/MountpointSelector.c
+++ b/widgets/src/MountpointSelector.c
@@ -68,7 +68,7 @@ static void anaconda_mountpoint_selector_get_property(GObject *object, guint pro
static void anaconda_mountpoint_selector_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void anaconda_mountpoint_selector_realize(GtkWidget *widget, gpointer user_data);
-static void anaconda_mountpoint_selector_finalize(AnacondaMountpointSelector *widget);
+static void anaconda_mountpoint_selector_finalize(GObject *object);
static void anaconda_mountpoint_selector_toggle_background(AnacondaMountpointSelector *widget);
@@ -77,7 +77,7 @@ static void anaconda_mountpoint_selector_class_init(AnacondaMountpointSelectorCl
object_class->set_property = anaconda_mountpoint_selector_set_property;
object_class->get_property = anaconda_mountpoint_selector_get_property;
- object_class->finalize = (GObjectFinalizeFunc) anaconda_mountpoint_selector_finalize;
+ object_class->finalize = anaconda_mountpoint_selector_finalize;
/**
* AnacondaMountpointSelector:name:
@@ -234,8 +234,11 @@ static void anaconda_mountpoint_selector_init(AnacondaMountpointSelector *mountp
gtk_container_add(GTK_CONTAINER(mountpoint), mountpoint->priv->grid);
}
-static void anaconda_mountpoint_selector_finalize(AnacondaMountpointSelector *widget) {
+static void anaconda_mountpoint_selector_finalize(GObject *object) {
+ AnacondaMountpointSelector *widget = ANACONDA_MOUNTPOINT_SELECTOR(object);
g_object_unref(widget->priv->cursor);
+
+ G_OBJECT_CLASS(anaconda_mountpoint_selector_parent_class)->finalize(object);
}
static void anaconda_mountpoint_selector_realize(GtkWidget *widget, gpointer user_data) {
diff --git a/widgets/src/SpokeSelector.c b/widgets/src/SpokeSelector.c
index 18ce8d5..e339965 100644
--- a/widgets/src/SpokeSelector.c
+++ b/widgets/src/SpokeSelector.c
@@ -72,7 +72,7 @@ G_DEFINE_TYPE(AnacondaSpokeSelector, anaconda_spoke_selector, GTK_TYPE_EVENT_BOX
static void anaconda_spoke_selector_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static void anaconda_spoke_selector_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void anaconda_spoke_selector_realize(GtkWidget *widget, gpointer user_data);
-static void anaconda_spoke_selector_finalize(AnacondaSpokeSelector *spoke);
+static void anaconda_spoke_selector_finalize(GObject *object);
static gboolean anaconda_spoke_selector_focus_changed(GtkWidget *widget, GdkEventFocus *event, gpointer user_data);
@@ -81,7 +81,7 @@ static void anaconda_spoke_selector_class_init(AnacondaSpokeSelectorClass *klass
object_class->set_property = anaconda_spoke_selector_set_property;
object_class->get_property = anaconda_spoke_selector_get_property;
- object_class->finalize = (GObjectFinalizeFunc) anaconda_spoke_selector_finalize;
+ object_class->finalize = anaconda_spoke_selector_finalize;
/**
* AnacondaSpokeSelector:icon:
@@ -301,8 +301,11 @@ static void anaconda_spoke_selector_init(AnacondaSpokeSelector *spoke) {
gtk_container_add(GTK_CONTAINER(spoke), spoke->priv->grid);
}
-static void anaconda_spoke_selector_finalize(AnacondaSpokeSelector *spoke) {
+static void anaconda_spoke_selector_finalize(GObject *object) {
+ AnacondaSpokeSelector *spoke = ANACONDA_SPOKE_SELECTOR(object);
g_object_unref(spoke->priv->cursor);
+
+ G_OBJECT_CLASS(anaconda_spoke_selector_parent_class)->finalize(object);
}
static void anaconda_spoke_selector_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) {
--
1.8.5.3
10 years, 3 months
[initial-setup][PATCH] Try to quit plymouth before running our X server instance (#1058329)
by Vratislav Podzimek
Otherwise the VT may end up not being switched (and they say it's not a bug)
leaving user staring at the plymouth animation forever with the Initial Setup
running on a different VT. By quitting plymouth first we get tty1 free to run
our X server there.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
systemd/initial-setup-graphical.service | 2 +-
systemd/initial-setup-text.service | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/systemd/initial-setup-graphical.service b/systemd/initial-setup-graphical.service
index 144a2d3..3e55cd1 100644
--- a/systemd/initial-setup-graphical.service
+++ b/systemd/initial-setup-graphical.service
@@ -7,7 +7,7 @@ ConditionKernelCommandLine=!rd.live.image
[Service]
Type=oneshot
-ExecStartPre=
+ExecStartPre=-/bin/plymouth quit
ExecStart=/bin/xinit /bin/firstboot-windowmanager /bin/initial-setup -- /bin/Xorg :9 -ac -nolisten tcp
TimeoutSec=0
RemainAfterExit=no
diff --git a/systemd/initial-setup-text.service b/systemd/initial-setup-text.service
index fcb5711..59c19a3 100644
--- a/systemd/initial-setup-text.service
+++ b/systemd/initial-setup-text.service
@@ -12,6 +12,7 @@ ConditionKernelCommandLine=!rd.live.image
[Service]
Type=oneshot
+ExecStartPre=-/bin/plymouth quit
ExecStartPre=/bin/kill -55 1
ExecStart=/bin/initial-setup
ExecStartPost=/bin/kill -54 1
--
1.8.5.3
10 years, 3 months
[lorax/master/rhel7] livemedia-creator: virt-image needs ram in MiB not KiB (#1061773)
by Brian C. Lane
Resolves: rhbz#1061773
---
src/sbin/livemedia-creator | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sbin/livemedia-creator b/src/sbin/livemedia-creator
index bb3c37a..805f86f 100755
--- a/src/sbin/livemedia-creator
+++ b/src/sbin/livemedia-creator
@@ -430,7 +430,7 @@ def make_appliance(disk_img, name, template, outfile, networks=None, ram=1024,
checksum_type="sha256", checksum=sha256.hexdigest())
try:
result = Template(filename=template).render(disks=[disk_info], name=name,
- arch=arch, memory=ram*1024, vcpus=vcpus, networks=networks,
+ arch=arch, memory=ram, vcpus=vcpus, networks=networks,
title=title, project=project, releasever=releasever)
except Exception:
log.error(text_error_template().render())
--
1.8.4.2
10 years, 3 months
[PATCH 4/4] Minor aesthetic cleanups (#1045250)
by Máirín Duffy
Some minor aesthetic updates to help enhance branding:
- Upped up the padding on the top navbar since it was a bit tight.
- Scaled the sidebar down just slightly to increase real estate
for content.
---
widgets/src/BaseWindow.c | 8 +++++---
widgets/src/HubWindow.c | 2 +-
widgets/src/StandaloneWindow.c | 2 +-
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/widgets/src/BaseWindow.c b/widgets/src/BaseWindow.c
index c9080c4..c04491b 100644
--- a/widgets/src/BaseWindow.c
+++ b/widgets/src/BaseWindow.c
@@ -227,9 +227,11 @@ static void anaconda_base_window_init(AnacondaBaseWindow *win) {
win->priv->nav_area = gtk_grid_new();
gtk_grid_set_row_homogeneous(GTK_GRID(win->priv->nav_area), FALSE);
gtk_grid_set_column_homogeneous(GTK_GRID(win->priv->nav_area), FALSE);
- gtk_widget_set_margin_left(win->priv->nav_area, 6);
- gtk_widget_set_margin_right(win->priv->nav_area, 6);
- gtk_widget_set_margin_top(win->priv->nav_area, 6);
+ gtk_widget_set_margin_left(win->priv->nav_area, 18);
+ gtk_widget_set_margin_right(win->priv->nav_area, 18);
+ gtk_widget_set_margin_top(win->priv->nav_area, 12);
+ gtk_widget_set_margin_bottom(win->priv->nav_area, 6);
+
gtk_container_add(GTK_CONTAINER(win->priv->nav_box), win->priv->nav_area);
diff --git a/widgets/src/HubWindow.c b/widgets/src/HubWindow.c
index 4327002..995a213 100644
--- a/widgets/src/HubWindow.c
+++ b/widgets/src/HubWindow.c
@@ -86,7 +86,7 @@ static int get_sidebar_width(GtkWidget *window) {
GtkAllocation allocation;
/* change value below to make sidebar bigger / smaller */
- float sidebar_width_percentage = 0.18;
+ float sidebar_width_percentage = 0.15;
gtk_widget_get_allocation(window, &allocation);
return allocation.width * sidebar_width_percentage;
}
diff --git a/widgets/src/StandaloneWindow.c b/widgets/src/StandaloneWindow.c
index 60bc6fd..ee73fdc 100644
--- a/widgets/src/StandaloneWindow.c
+++ b/widgets/src/StandaloneWindow.c
@@ -74,7 +74,7 @@ static int get_sidebar_width(GtkWidget *window) {
GtkAllocation allocation;
/* change value below to make sidebar bigger / smaller */
- float sidebar_width_percentage = 0.18;
+ float sidebar_width_percentage = 0.15;
gtk_widget_get_allocation(window, &allocation);
return allocation.width * sidebar_width_percentage;
}
--
1.8.4.2
10 years, 3 months
[PATCH 3/4] Add a topbar design to SpokeWindows. (#1045250)
by Máirín Duffy
This adds a topbar design to the SpokeWindows to complement the
sidebar on the StandaloneWindows and the HubWindows. The style
is set in the anaconda-gtk.css file.
---
data/anaconda-gtk.css | 37 ++++++++++++++++++++++++++-----------
widgets/src/BaseWindow.c | 3 ++-
widgets/src/SpokeWindow.c | 34 ----------------------------------
3 files changed, 28 insertions(+), 46 deletions(-)
diff --git a/data/anaconda-gtk.css b/data/anaconda-gtk.css
index a56ddf6..af51e45 100644
--- a/data/anaconda-gtk.css
+++ b/data/anaconda-gtk.css
@@ -1,32 +1,47 @@
/* vendor-specific colors/images */
-@define-color sidebar_redhat #41413e;
-@define-color sidebar_fedora #006eb4;
+@define-color redhat #41413e;
+@define-color fedora #006eb4;
/* logo and sidebar classes for RHEL */
+
+.sidebar {
+ background-image: url('/usr/share/anaconda/pixmaps/sidebar-bg.png');
+ background-color: @redhat;
+}
+
.logo {
- background-image: url('/usr/share/anaconda/pixmaps/redhat-logo.png');
+ background-image: url('/usr/share/anaconda/pixmaps/sidebar-logo.png');
background-position: 50% 20px;
background-repeat: no-repeat;
background-color: transparent;
}
-.sidebar {
- background-image: url('/usr/share/anaconda/pixmaps/redhat-bg.png');
- background-color: @sidebar_redhat;
+AnacondaSpokeWindow #nav-box {
+ background-color: @redhat;
+ background-image: url('/usr/share/anaconda/pixmaps/topbar-bg.png');
+ background-repeat: repeat;
+ color: white;
+}
+
+AnacondaSpokeWindow #layout-indicator {
+ color: black;
}
/* swap these into logo & sidebar classes for Fedora */
/*
-.logo-fedora {
- background-image: url('/usr/share/anaconda/pixmaps/fedora-logo.png');
+.logo{
+ background-image: url('/usr/share/anaconda/pixmaps/logo.png');
background-position: 50% 20px;
background-repeat: no-repeat;
background-color: transparent;
}
-.sidebar-fedora {
- background-image: url('/usr/share/anaconda/pixmaps/noise-texture.png');
- background-color: @sidebar_fedora;
+.sidebar {
+ background-color: @fedora;
+}
+
+AnacondaSpokeWindow #nav-box {
+ background-color: @fedora;
}
*/
diff --git a/widgets/src/BaseWindow.c b/widgets/src/BaseWindow.c
index 0fcf4e8..c9080c4 100644
--- a/widgets/src/BaseWindow.c
+++ b/widgets/src/BaseWindow.c
@@ -221,7 +221,7 @@ static void anaconda_base_window_init(AnacondaBaseWindow *win) {
*/
win->priv->nav_box = gtk_event_box_new();
- gtk_widget_set_app_paintable(win->priv->nav_box, TRUE);
+ gtk_widget_set_name(win->priv->nav_box, "nav-box");
gtk_box_pack_start(GTK_BOX(win->priv->main_box), win->priv->nav_box, FALSE, FALSE, 0);
win->priv->nav_area = gtk_grid_new();
@@ -281,6 +281,7 @@ static void anaconda_base_window_init(AnacondaBaseWindow *win) {
win->priv->layout_indicator = anaconda_layout_indicator_new();
anaconda_layout_indicator_set_label_width(ANACONDA_LAYOUT_INDICATOR(win->priv->layout_indicator),
LAYOUT_INDICATOR_LABEL_WIDTH);
+ gtk_widget_set_name(win->priv->layout_indicator, "layout-indicator");
gtk_widget_set_halign(win->priv->layout_indicator, GTK_ALIGN_START);
gtk_widget_set_hexpand(win->priv->layout_indicator, FALSE);
gtk_widget_set_margin_top(win->priv->layout_indicator, 6);
diff --git a/widgets/src/SpokeWindow.c b/widgets/src/SpokeWindow.c
index 93f1b30..dc32915 100644
--- a/widgets/src/SpokeWindow.c
+++ b/widgets/src/SpokeWindow.c
@@ -165,44 +165,10 @@ static void anaconda_spoke_window_init(AnacondaSpokeWindow *win) {
}
static void anaconda_spoke_window_realize(GtkWidget *widget, gpointer user_data) {
- GtkWidget *nav_box;
GtkAccelGroup *accel_group;
- GError *error;
- GdkPixbuf *pixbuf;
- cairo_pattern_t *pattern;
- cairo_surface_t *surface;
- cairo_t *cr;
AnacondaSpokeWindow *window = ANACONDA_SPOKE_WINDOW(widget);
- /* Set the background gradient in the header. If we fail to load the
- * background for any reason, just print an error message and display the
- * header without an image.
- */
- error = NULL;
- nav_box = anaconda_base_window_get_nav_area_background_window(ANACONDA_BASE_WINDOW(window));
- pixbuf = gdk_pixbuf_new_from_file_at_scale("/usr/share/anaconda/pixmaps/anaconda_spoke_header.png",
- -1, gdk_window_get_height(gtk_widget_get_window(nav_box)),
- FALSE, &error);
-
- if (!pixbuf) {
- fprintf(stderr, "could not load header background: %s\n", error->message);
- g_error_free(error);
- } else {
- surface = gdk_window_create_similar_surface(gtk_widget_get_window(nav_box), CAIRO_CONTENT_COLOR_ALPHA,
- gdk_pixbuf_get_width(pixbuf), gdk_pixbuf_get_height(pixbuf));
- cr = cairo_create(surface);
-
- gdk_cairo_set_source_pixbuf(cr, pixbuf, 0, 0);
- cairo_paint(cr);
- cairo_destroy(cr);
- pattern = cairo_pattern_create_for_surface(surface);
- cairo_surface_destroy(surface);
-
- cairo_pattern_set_extend(pattern, CAIRO_EXTEND_REPEAT);
- gdk_window_set_background_pattern(gtk_widget_get_window(nav_box), pattern);
- }
-
/* Pressing F12 should send you back to the hub, similar to how the old UI worked. */
accel_group = gtk_accel_group_new();
gtk_window_add_accel_group(GTK_WINDOW(window), accel_group);
--
1.8.4.2
10 years, 3 months
[PATCH] Require systemd
by David Shea
Anaconda needs systemctl and systemd-machine-id-setup and probably
another thing or two to be available.
Resolves: rhbz#1060823
---
anaconda.spec.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/anaconda.spec.in b/anaconda.spec.in
index 8afdcdc..6dfdabc 100644
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -127,6 +127,7 @@ Requires: chrony
Requires: ntpdate
Requires: rsync
Requires: hostname
+Requires: systemd
%ifarch %{ix86} x86_64
Requires: fcoe-utils >= %{fcoeutilsver}
%endif
--
1.8.5.3
10 years, 3 months
[blivet] Add another .decode("utf-8") to humanReadable (#1059807)
by David Shea
This way Size.humanReadable always returns a unicode object that __str__
can always convert back to a str.
---
blivet/size.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/blivet/size.py b/blivet/size.py
index 65668c5..03bfa38 100644
--- a/blivet/size.py
+++ b/blivet/size.py
@@ -279,7 +279,7 @@ class Size(Decimal):
check = self._trimEnd("%d" % self)
if abs(Decimal(check)) < 1000:
- return "%s %s" % (check, _("B"))
+ return "%s %s" % (check, _("B").decode("utf-8"))
for factor, prefix, abbr in _xlated_prefixes():
newcheck = super(Size, self).__div__(Decimal(factor))
--
1.8.5.3
10 years, 3 months
[PATCH] Move save_netinfo into a hook (#1048231)
by Brian C. Lane
There were a couple of issues here - echoing a command into a hookfile
isn't the right way to setup a hook anymore, use inst_hook in
module-setup.sh for that. And the script was being run after
11-fetch-kickstart-net.sh because of its name. It is now installed as
00-anaconda-ifcfg.sh
Resolves: rhbz#1048231
---
dracut/Makefile.am | 1 +
dracut/anaconda-ifcfg.sh | 8 ++++++++
dracut/module-setup.sh | 1 +
dracut/parse-anaconda-options.sh | 3 ---
4 files changed, 10 insertions(+), 3 deletions(-)
create mode 100755 dracut/anaconda-ifcfg.sh
diff --git a/dracut/Makefile.am b/dracut/Makefile.am
index 3bab16a..c3080bc 100644
--- a/dracut/Makefile.am
+++ b/dracut/Makefile.am
@@ -33,6 +33,7 @@ dist_dracut_SCRIPTS = module-setup.sh \
anaconda-diskroot \
anaconda-copy-ks.sh \
anaconda-copy-cmdline.sh \
+ anaconda-ifcfg.sh \
fetch-kickstart-net.sh \
fetch-kickstart-disk \
fetch-updates-disk \
diff --git a/dracut/anaconda-ifcfg.sh b/dracut/anaconda-ifcfg.sh
new file mode 100755
index 0000000..c1718f1
--- /dev/null
+++ b/dracut/anaconda-ifcfg.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+command -v getarg >/dev/null || . /lib/dracut-lib.sh
+
+# initqueue/online hook passes interface name as $1
+netif="$1"
+
+# make sure we get ifcfg for every interface that comes up
+save_netinfo $netif
diff --git a/dracut/module-setup.sh b/dracut/module-setup.sh
index 4dd8a4c..59d3ad7 100755
--- a/dracut/module-setup.sh
+++ b/dracut/module-setup.sh
@@ -32,6 +32,7 @@ install() {
inst_hook pre-trigger 50 "$moddir/kickstart-genrules.sh"
inst_hook pre-trigger 50 "$moddir/updates-genrules.sh"
inst_hook initqueue/settled 00 "$moddir/anaconda-ks-sendheaders.sh"
+ inst_hook initqueue/online 00 "$moddir/anaconda-ifcfg.sh"
inst_hook initqueue/online 80 "$moddir/anaconda-netroot.sh"
inst "$moddir/anaconda-diskroot" "/sbin/anaconda-diskroot"
inst_hook pre-pivot 50 "$moddir/anaconda-copy-ks.sh"
diff --git a/dracut/parse-anaconda-options.sh b/dracut/parse-anaconda-options.sh
index 4ed6650..caa977d 100755
--- a/dracut/parse-anaconda-options.sh
+++ b/dracut/parse-anaconda-options.sh
@@ -127,9 +127,6 @@ fi
# for vnc bring network up in initramfs so that cmdline configuration is used
getargbool 0 vnc inst.vnc && warn "anaconda requiring network for vnc" && set_neednet
-# make sure we get ifcfg for every interface that comes up
-echo 'save_netinfo $netif' > $hookdir/initqueue/online/anaconda-ifcfg.sh
-
# Driver Update Disk
warn_renamed_arg "dd" "inst.dd"
--
1.8.4.2
10 years, 3 months
[master/rhel7-branch] Once again fix cmdline error handling. (#1034773)
by Samantha N. Bueno
Raise cmdline error if a user attempts to install a missing pkg
during non-interactive ks install.
This also makes a minimal change to the original CmdlineError str
which was displayed.
Resolves: rhbz#1034773
---
pyanaconda/exception.py | 14 +++++++-------
pyanaconda/packaging/yumpayload.py | 7 +++++++
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/pyanaconda/exception.py b/pyanaconda/exception.py
index a9cdceb..13f5ba9 100644
--- a/pyanaconda/exception.py
+++ b/pyanaconda/exception.py
@@ -93,13 +93,13 @@ class AnacondaExceptionHandler(ExceptionHandler):
sys.exit(0)
elif (issubclass (ty, CmdlineError)):
- cmdline_error_msg = _("\nThe installation was stopped due to "
- "incomplete spokes detected while running "
- "in non-interactive cmdline mode. Since there "
- "can not be any questions in cmdline mode, "
- "edit your kickstart file and retry "
- "installation.\nThe exact error message is: "
- "\n\n%s.\n\nThe installer will now terminate.") % str(value)
+ cmdline_error_msg = _("\nThe installation was stopped due to an "
+ "error which occurred while running in "
+ "non-interactive cmdline mode. Since there can "
+ "not be any questions in cmdline mode, edit "
+ "your kickstart file and retry installation. "
+ "\nThe exact error message is: \n\n%s. \n\nThe "
+ "installer will now terminate.") % str(value)
# since there is no UI in cmdline mode and it is completely
# non-interactive, we can't show a message window asking the user
diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index 4b4a226..f8b395c 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -1350,6 +1350,13 @@ reposdir=%s
return
if errorHandler.cb(exn, str(exn)) == ERROR_RAISE:
+ if flags.automatedInstall and not flags.ksprompt:
+ # If we're doing non-interactive ks install, raise CmdlineError
+ # otherwise the system will just reboot automatically
+ errtxt = _("CmdlineError: Missing package: %s" % str(exn))
+ log.error(errtxt)
+ raise CmdlineError(errtxt)
+
# The progress bar polls kind of slowly, thus installation could
# still continue for a bit before the quit message is processed.
# Let's sleep forever to prevent any further actions and wait for
--
1.8.3.1
10 years, 3 months
[PATCH] Add a sidebar to the standalone windows (#1045250)
by Máirín Duffy
This adds a sidebar to the left of the standalone windows. The reason
for this is to visually reinforce the left-to-right linear nature of
the standalone windows. There is a variable (sidebar_width_percentage)
you can set to control the percentage width of the screen that the
sidebar occupies - I've set it to 18% which seems reasonable. It auto-
centers the logo on top of the sidebar as well. There are three layers
to the sidebar: the base color, a texture pixbuf, and the logo pixbuf
on top.
---
widgets/src/StandaloneWindow.c | 67 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 67 insertions(+)
diff --git a/widgets/src/StandaloneWindow.c b/widgets/src/StandaloneWindow.c
index a770bc7..87ed03d 100644
--- a/widgets/src/StandaloneWindow.c
+++ b/widgets/src/StandaloneWindow.c
@@ -70,8 +70,75 @@ static void anaconda_standalone_window_realize(GtkWidget *widget,
G_DEFINE_TYPE(AnacondaStandaloneWindow, anaconda_standalone_window, ANACONDA_TYPE_BASE_WINDOW)
+static int get_sidebar_width(GtkWidget *window) {
+ GtkAllocation allocation;
+ /* change value below to make sidebar bigger / smaller */
+ float sidebar_width_percentage = .18;
+ gtk_widget_get_allocation(window, &allocation);
+ return allocation.width * sidebar_width_percentage;
+}
+
+static int get_sidebar_height(GtkWidget *window) {
+ GtkAllocation allocation;
+ gtk_widget_get_allocation(window, &allocation);
+ return allocation.height;
+}
+
+/* function to override default drawing to insert sidebar image */
+gboolean anaconda_standalone_window_on_draw(GtkWidget *win, cairo_t *cr) {
+
+ /* Create sidebar */
+ GTK_WIDGET_CLASS(anaconda_standalone_window_parent_class)->draw(win,cr);
+ cairo_rectangle(cr, 0, 0, get_sidebar_width(win), get_sidebar_height(win));
+
+ /* Configure sidebar base color */
+ /* Dark grey for RHEL: 65/255.0, 65/255.0, 62/255.0, 1 */
+ /* Blue for Fedora: 60/255.0, 110/255.0, 180/255.0, 1 */
+ cairo_set_source_rgba(cr, 65/255.0, 65/255.0, 62/255.0, 1);
+ cairo_fill_preserve(cr);
+
+ /* Configure sidebar texture image */
+ GdkPixbuf *pixbuf_background = gdk_pixbuf_new_from_file("/usr/share/anaconda/pixmaps/noise-texture.png", NULL);
+ cairo_surface_t *surface= gdk_cairo_surface_create_from_pixbuf(pixbuf_background, 0, gtk_widget_get_window(GTK_WIDGET(win)));
+ cairo_set_source_surface(cr, surface, 0, 0);
+ cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REPEAT);
+ cairo_fill(cr);
+
+ /* Configure logo image overlaid on sidebar */
+ GdkPixbuf *pixbuf_logo = gdk_pixbuf_new_from_file("/usr/share/anaconda/pixmaps/redhat-logo.png", NULL);
+ if (pixbuf_logo != NULL) {
+ double x_value = (get_sidebar_width(win) - gdk_pixbuf_get_width(pixbuf_logo))/2;
+ double y_value = 20;
+ cairo_surface_t *surface= gdk_cairo_surface_create_from_pixbuf(pixbuf_logo, 0, gtk_widget_get_window(GTK_WIDGET(win)));
+ cairo_set_source_surface(cr, surface, x_value, y_value);
+ cairo_rectangle(cr, x_value, y_value, gdk_pixbuf_get_width(pixbuf_logo), gdk_pixbuf_get_height(pixbuf_logo));
+ cairo_fill(cr);
+ }
+ return TRUE; /* TRUE to avoid default draw handler */
+}
+
+/* Move base window content appropriate amount of space to the right to make room for sidebar */
+static void anaconda_standalone_window_size_allocate (GtkWidget *window, GtkAllocation *allocation) {
+ GtkAllocation child_allocation;
+ GtkWidget *child;
+
+ gtk_widget_set_allocation(window, allocation);
+ int sidebar_width = get_sidebar_width(window);
+ child_allocation.x = allocation->x+sidebar_width;
+ child_allocation.y = allocation->y;
+ child_allocation.width = allocation->width-sidebar_width;
+ child_allocation.height = allocation->height;
+
+ child = gtk_bin_get_child (GTK_BIN (window));
+ if (child && gtk_widget_get_visible (child))
+ gtk_widget_size_allocate (child, &child_allocation);
+}
+
static void anaconda_standalone_window_class_init(AnacondaStandaloneWindowClass *klass) {
GObjectClass *object_class = G_OBJECT_CLASS(klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
+ widget_class->draw=anaconda_standalone_window_on_draw;
+ widget_class->size_allocate=anaconda_standalone_window_size_allocate;
klass->quit_clicked = NULL;
klass->continue_clicked = NULL;
--
1.8.4.2
10 years, 3 months