YaST Commits
Threads by month
- ----- 2025 -----
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
July 2008
- 26 participants
- 870 discussions
[yast-commit] r49534 - in /trunk/bootloader: VERSION package/yast2-bootloader.changes
by juhliarik@svn.opensuse.org 31 Jul '08
by juhliarik@svn.opensuse.org 31 Jul '08
31 Jul '08
Author: juhliarik
Date: Thu Jul 31 10:36:03 2008
New Revision: 49534
URL: http://svn.opensuse.org/viewcvs/yast?rev=49534&view=rev
Log:
new version 2.17.7
Modified:
trunk/bootloader/VERSION
trunk/bootloader/package/yast2-bootloader.changes
Modified: trunk/bootloader/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/VERSION?rev=49534&r1=…
==============================================================================
--- trunk/bootloader/VERSION (original)
+++ trunk/bootloader/VERSION Thu Jul 31 10:36:03 2008
@@ -1 +1 @@
-2.17.6
+2.17.7
Modified: trunk/bootloader/package/yast2-bootloader.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/package/yast2-bootloa…
==============================================================================
--- trunk/bootloader/package/yast2-bootloader.changes (original)
+++ trunk/bootloader/package/yast2-bootloader.changes Thu Jul 31 10:36:03 2008
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Thu Jul 31 10:27:42 CEST 2008 - juhliarik(a)suse.cz
+
+- added support for remaping windows chainloader boot section
+ (fate #301994)
+- 2.17.7
+
+-------------------------------------------------------------------
Tue Jul 29 18:18:38 CEST 2008 - juhliarik(a)suse.cz
- update solution for saving kernel args to
--
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] r49533 - in /trunk/bootloader/src: clients/inst_bootloader.ycp grub/misc.ycp modules/BootGRUB.ycp routines/misc.ycp
by juhliarik@svn.opensuse.org 31 Jul '08
by juhliarik@svn.opensuse.org 31 Jul '08
31 Jul '08
Author: juhliarik
Date: Thu Jul 31 10:27:01 2008
New Revision: 49533
URL: http://svn.opensuse.org/viewcvs/yast?rev=49533&view=rev
Log:
added support for remaping windows boot section if widnows is on the
second disk fate #301994
M bootloader/src/grub/misc.ycp
* added debug/log messages
M bootloader/src/modules/BootGRUB.ycp
* added calling function for checking windows chainloader
Modified:
trunk/bootloader/src/clients/inst_bootloader.ycp
trunk/bootloader/src/grub/misc.ycp
trunk/bootloader/src/modules/BootGRUB.ycp
trunk/bootloader/src/routines/misc.ycp
Modified: trunk/bootloader/src/clients/inst_bootloader.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/clients/inst_boot…
==============================================================================
--- trunk/bootloader/src/clients/inst_bootloader.ycp (original)
+++ trunk/bootloader/src/clients/inst_bootloader.ycp Thu Jul 31 10:27:01 2008
@@ -52,7 +52,7 @@
});
}
-
+// FATE #302245 save kernel args etc to /etc/sysconfig/bootloader
BootCommon::WriteToSysconf(true);
y2milestone ("finish inst_bootloader");
Modified: trunk/bootloader/src/grub/misc.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/grub/misc.ycp?rev…
==============================================================================
--- trunk/bootloader/src/grub/misc.ycp (original)
+++ trunk/bootloader/src/grub/misc.ycp Thu Jul 31 10:27:01 2008
@@ -1105,10 +1105,12 @@
foreach (integer idx, list_index,
{
sections[idx, "remap"] = "true";
- sections[idx, "makactive"] = "true";
+ sections[idx, "makeactive"] = "true";
+ y2milestone("Added remap and makeactive for section: %1", sections[idx]:$[]);
});
}
+ y2debug("Checking sections for windows chainloader: %1", sections);
return sections;
}
Modified: trunk/bootloader/src/modules/BootGRUB.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootGRUB.…
==============================================================================
--- trunk/bootloader/src/modules/BootGRUB.ycp (original)
+++ trunk/bootloader/src/modules/BootGRUB.ycp Thu Jul 31 10:27:01 2008
@@ -624,9 +624,15 @@
*/
global boolean Save (boolean clean, boolean init, boolean flush) {
+
+ // check if windows is on second disk and add remap if it is necessary
+ // FATE #301994: Correct device mapping in case windows is installed on the second HD
+ BootCommon::sections = checkWidnowsSection(BootCommon::sections);
+
// now really save the settings
boolean ret = BootCommon::Save (clean, init, flush);
importMetaData();
+
return ret;
}
Modified: trunk/bootloader/src/routines/misc.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/routines/misc.ycp…
==============================================================================
--- trunk/bootloader/src/routines/misc.ycp (original)
+++ trunk/bootloader/src/routines/misc.ycp Thu Jul 31 10:27:01 2008
@@ -1604,7 +1604,7 @@
}
-/**
+/** FATE #302245 save kernel args etc to /etc/sysconfig/bootloader
* Function write/update info in /etc/sysconfig/bootloader
* @param booloean true if it called from inst_bootloader.ycp
*/
--
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] r49532 - in /trunk/auditd: agents/auditd.scr src/complex.ycp src/dialogs.ycp src/wizards.ycp
by gs@svn.opensuse.org 31 Jul '08
by gs@svn.opensuse.org 31 Jul '08
31 Jul '08
Author: gs
Date: Thu Jul 31 10:09:52 2008
New Revision: 49532
URL: http://svn.opensuse.org/viewcvs/yast?rev=49532&view=rev
Log:
read/write dispatcher settings
Modified:
trunk/auditd/agents/auditd.scr
trunk/auditd/src/complex.ycp
trunk/auditd/src/dialogs.ycp
trunk/auditd/src/wizards.ycp
Modified: trunk/auditd/agents/auditd.scr
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/agents/auditd.scr?rev=495…
==============================================================================
--- trunk/auditd/agents/auditd.scr (original)
+++ trunk/auditd/agents/auditd.scr Thu Jul 31 10:09:52 2008
@@ -28,7 +28,7 @@
`IniAgent( "/etc/audit/auditd.conf",
$[
"options" : [ "global_values", "repeat_names", "flat" ],
- "comments" : [ "^[ \t]*#.*$", "^[ \t]*$", "^#.*$" ],
+ "comments" : [ "^[ \t]*#.*$", "^[ \t]*$" ],
"params" : [
// Options with one value ('yes' / 'no')
$[ "match" : [ "^[ \t]*([^ \t]+)[ \t = ]+([^ \t]+)[ \t]+$", "%s = %s" ]],
Modified: trunk/auditd/src/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/complex.ycp?rev=49532…
==============================================================================
--- trunk/auditd/src/complex.ycp (original)
+++ trunk/auditd/src/complex.ycp Thu Jul 31 10:09:52 2008
@@ -107,7 +107,7 @@
string file_name = UI::AskForExistingFile("/var/log/audit", "*.log", _("Select the log file") );
UI::ChangeWidget( `id("log_file"), `Value, file_name );
- y2milestone( "Logfile changed to: %1", file_name );
+ y2milestone( "Logfile set to: %1", file_name );
}
return nil;
}
@@ -139,13 +139,44 @@
}
void InitDispatcherDialog (string id) {
- y2milestone( "Init dispatcher" );
+
+ // Set all values to values read from /etc/audit/auditd.conf
+ foreach (string key, ["dispatcher",
+ "disp_qos" ], {
+ UI::ChangeWidget(`id(key), `Value, (Auditd::GetAuditdOption(key)));
+ });
+
+ y2milestone( "Init dispatcher dialog" );
+}
+
+symbol HandleDispatcherDialog(string id, map event) {
+ any action = event["ID"]:nil;
+
+ if ( action == "select_disp" )
+ {
+ string file_name = UI::AskForExistingFile("/sbin", "*", _("Select the dispatcher program") );
+
+ UI::ChangeWidget( `id("dispatcher"), `Value, file_name );
+ y2milestone( "Dispatcher program set to: %1", file_name );
+ }
+ return nil;
}
void StoreDispatcherDialog (string id, map event) {
- y2milestone( "Store dispatcher" );
+
+ // Store all values in SETTINGS
+ Auditd::SetAuditdOption( "freq", tostring( (integer)UI::QueryWidget( `id("freq"), `Value ) ) );
+ Auditd::SetAuditdOption( "num_logs", tostring( (integer)UI::QueryWidget( `id("num_logs"), `Value ) ) );
+
+ foreach (string key, ["dispatcher",
+ "disp_qos"], {
+ Auditd::SetAuditdOption( key, (string) UI::QueryWidget(`id(key), `Value) );
+ });
+
+ y2milestone( "Store dispatcher dialog" );
}
+
void InitDiskspaceSettingsDialog (string id) {
y2milestone( "Init dispatcher" );
}
Modified: trunk/auditd/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/dialogs.ycp?rev=49532…
==============================================================================
--- trunk/auditd/src/dialogs.ycp (original)
+++ trunk/auditd/src/dialogs.ycp Thu Jul 31 10:09:52 2008
@@ -50,6 +50,7 @@
term LogfileSettingsDialogContent () {
return `MarginBox( mbox_x, mbox_y,
`VBox(
+ `VStretch(),
`Frame (
_("General Settings"),
`VBox (
@@ -90,6 +91,7 @@
)
)
),
+ `VStretch(),
`Frame (
_("Size and Action"),
`HBox (
@@ -108,6 +110,7 @@
`HWeight( 1, `InputField(`id("action_mail_acct"), _("Action Mail Account")))
)
),
+ `VStretch(),
`Frame(
_("Computer Names"),
`HBox(
@@ -130,15 +133,27 @@
term DispatcherDialogContent () {
return `MarginBox( mbox_x, mbox_y,
`VBox(
- `VSpacing(1.0),
+ `VSpacing(2.0),
`Frame (
- _(""),
+ _("Dispatcher Settings"),
`VBox (
- /* A text entry */
- `Left(`InputField(`id("dispatcher"), _("Dispatcher Name"))),
-
- `Left(`InputField(`id("max_log_file_action"), _("Action ")))
-
+ `VSquash(
+ `HBox(
+ // Label for InputField
+ `InputField(`id("dispatcher"), `opt(`hstretch), _("Dispatcher Name")),
+ `HSpacing(2.0),
+ `VBox(
+ `VSpacing(),
+ // Label for PushButton
+ `Bottom(`PushButton(`id("select_disp"), _("Select Fi&le")))
+ )
+ )
+ ),
+ `Left(`ComboBox(`id("disp_qos"), _("Communication"),
+ [`item(`id("lossy"), "lossy", true ),
+ `item(`id("lossless"), "lossless" )
+ ])
+ )
)
),
`VStretch()
Modified: trunk/auditd/src/wizards.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/wizards.ycp?rev=49532…
==============================================================================
--- trunk/auditd/src/wizards.ycp (original)
+++ trunk/auditd/src/wizards.ycp Thu Jul 31 10:09:52 2008
@@ -58,6 +58,7 @@
"widget" : `custom,
"help" : HELPS["dispatcher"]:"",
"custom_widget" : DispatcherDialogContent(),
+ "handle" : HandleDispatcherDialog,
"init" : InitDispatcherDialog,
"store" : StoreDispatcherDialog,
],
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
Author: rpmcruz
Date: Thu Jul 31 03:36:55 2008
New Revision: 49531
URL: http://svn.opensuse.org/viewcvs/yast?rev=49531&view=rev
Log:
* src/yzyppwrapper.h/.cc: add attributes arch to Version and url to
Repository. Added extra options to names query.
* src/YGPackageSelector.cc: some re-design of the layout.
* src/ygtkwizard.h/.c: re-worked the layout. Instead of a customer container,
it now uses gtk ordinary layouting.
* src/ygtklinklabel.h/.c: new widget: a label with a clickable link at its
end.
* src/ygtkhandlebox.h/.c: new widget: extends GtkHandleBox, supporting
resizing of the deatached window.
* src/YGUtils.h/.cc: got rid of splitString(). Replaced its usage by
g_strsplit().
* src/YGDumbTab.cc: bug fix 411890: it looks like tabs can now have
shortcuts: honor them.
Added:
trunk/gtk/src/ygtkhandlebox.c
trunk/gtk/src/ygtkhandlebox.h
trunk/gtk/src/ygtklinklabel.c
trunk/gtk/src/ygtklinklabel.h
Modified:
trunk/gtk/ChangeLog
trunk/gtk/src/Makefile.am
trunk/gtk/src/YGDumbTab.cc
trunk/gtk/src/YGLabel.cc
trunk/gtk/src/YGPackageSelector.cc
trunk/gtk/src/YGUI.cc
trunk/gtk/src/YGUtils.cc
trunk/gtk/src/YGUtils.h
trunk/gtk/src/YGWizard.cc
trunk/gtk/src/pkg-selector-help.h
trunk/gtk/src/ygtksteps.c
trunk/gtk/src/ygtkwizard.c
trunk/gtk/src/ygtkwizard.h
trunk/gtk/src/ygtkzyppwrapper.cc
trunk/gtk/src/ygtkzyppwrapper.h
trunk/gtk/src/yzyppwrapper.cc
trunk/gtk/src/yzyppwrapper.h
Modified: trunk/gtk/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/ChangeLog?rev=49531&r1=49530…
==============================================================================
--- trunk/gtk/ChangeLog (original)
+++ trunk/gtk/ChangeLog Thu Jul 31 03:36:55 2008
@@ -1,3 +1,25 @@
+2008-07-30 Ricardo Cruz <rpmcruz(a)alunos.dcc.fc.up.pt>
+
+ * src/yzyppwrapper.h/.cc: add attributes arch to Version and url to
+ Repository. Added extra options to names query.
+
+ * src/YGPackageSelector.cc: some re-design of the layout.
+
+ * src/ygtkwizard.h/.c: re-worked the layout. Instead of a customer container,
+ it now uses gtk ordinary layouting.
+
+ * src/ygtklinklabel.h/.c: new widget: a label with a clickable link at its
+ end.
+
+ * src/ygtkhandlebox.h/.c: new widget: extends GtkHandleBox, supporting
+ resizing of the deatached window.
+
+ * src/YGUtils.h/.cc: got rid of splitString(). Replaced its usage by
+ g_strsplit().
+
+ * src/YGDumbTab.cc: bug fix 411890: it looks like tabs can now have
+ shortcuts: honor them.
+
2008-07-21 JP Rosevear <jpr(a)novell.com>
* Version 2.16.17
Modified: trunk/gtk/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/Makefile.am?rev=49531&r1…
==============================================================================
--- trunk/gtk/src/Makefile.am (original)
+++ trunk/gtk/src/Makefile.am Thu Jul 31 03:36:55 2008
@@ -54,6 +54,8 @@
ygtktogglebutton.c \
ygtkhtmlwrap.c \
ygtktimezonepicker.c \
+ ygtkhandlebox.c \
+ ygtklinklabel.c \
yzyppwrapper.cc \
yzypptags.cc \
ygtkzyppwrapper.cc \
Modified: trunk/gtk/src/YGDumbTab.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGDumbTab.cc?rev=49531&r…
==============================================================================
--- trunk/gtk/src/YGDumbTab.cc (original)
+++ trunk/gtk/src/YGDumbTab.cc Thu Jul 31 03:36:55 2008
@@ -45,9 +45,9 @@
virtual void addItem (YItem *item)
{
YDumbTab::addItem (item);
-
GtkWidget *tab_label, *image = 0, *label;
- label = gtk_label_new (item->label().c_str());
+ label = gtk_label_new (YGUtils::mapKBAccel (item->label()).c_str());
+ gtk_label_set_use_underline (GTK_LABEL (label), TRUE);
if (item->hasIconName()) {
string path = iconFullPath (item->iconName());
GdkPixbuf *pixbuf = YGUtils::loadPixbuf (path);
@@ -135,8 +135,6 @@
GtkWidget *child = gtk_notebook_get_nth_page (notebook, item->index());
std::string label = YGUtils::mapKBAccel (item->label());
gtk_notebook_set_tab_label_text (notebook, child, label.c_str());
- gtk_label_set_use_underline (
- GTK_LABEL (gtk_notebook_get_tab_label (notebook, child)), TRUE);
}
}
Modified: trunk/gtk/src/YGLabel.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGLabel.cc?rev=49531&r1=…
==============================================================================
--- trunk/gtk/src/YGLabel.cc (original)
+++ trunk/gtk/src/YGLabel.cc Thu Jul 31 03:36:55 2008
@@ -18,8 +18,10 @@
{
IMPL
gtk_misc_set_alignment (GTK_MISC (getWidget()), 0.0, 0.5);
- if (outputField)
+ if (outputField) {
gtk_label_set_selectable (GTK_LABEL (getWidget()), TRUE);
+ gtk_label_set_single_line_mode (GTK_LABEL (getWidget()), TRUE);
+ }
if (heading)
YGUtils::setWidgetFont (getWidget(), PANGO_WEIGHT_BOLD, PANGO_SCALE_LARGE);
setLabel (text);
@@ -27,16 +29,8 @@
virtual void setText (const string &label)
{
- if (isOutputField()) {
- std::string l (label);
- std::string::size_type i = l.find ('\n', 0);
- if (i != std::string::npos)
- l.erase (i);
- gtk_label_set_label (GTK_LABEL (getWidget()), l.c_str());
- }
- else
- gtk_label_set_label (GTK_LABEL (getWidget()), label.c_str());
YLabel::setText (label);
+ gtk_label_set_label (GTK_LABEL (getWidget()), label.c_str());
}
YGWIDGET_IMPL_COMMON
Modified: trunk/gtk/src/YGPackageSelector.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGPackageSelector.cc?rev…
==============================================================================
--- trunk/gtk/src/YGPackageSelector.cc (original)
+++ trunk/gtk/src/YGPackageSelector.cc Thu Jul 31 03:36:55 2008
@@ -19,6 +19,7 @@
#include "ygtkscrolledwindow.h"
#include "ygtktogglebutton.h"
#include "ygtkhtmlwrap.h"
+#include "ygtkhandlebox.h"
#include "ygtkzyppwrapper.h"
// utilities
@@ -31,6 +32,14 @@
return image;
}
+static GdkPixbuf *loadThemeIcon (const char *icon, int size)
+{
+ GtkIconTheme *icons = gtk_icon_theme_get_default();
+ GdkPixbuf *pixbuf = gtk_icon_theme_load_icon (icons, icon, size,
+ GtkIconLookupFlags (0), NULL);
+ return pixbuf;
+}
+
inline bool CAN_OPEN_URIS()
{ return g_file_test ("/usr/bin/gnome-open", G_FILE_TEST_IS_EXECUTABLE); }
inline void OPEN_URI (const char *uri)
@@ -428,8 +437,11 @@
G_CALLBACK (popup_button_cb), this);
g_signal_connect_after (G_OBJECT (m_widget), "size-allocate",
G_CALLBACK (size_allocated_cb), this);
- if (showTooltips)
- gtk_tree_view_set_tooltip_column (view, YGtkZyppModel::PATTERN_DESCRIPTION_COLUMN);
+ if (showTooltips) {
+ gtk_widget_set_has_tooltip (m_widget, TRUE);
+ g_signal_connect (G_OBJECT (m_widget), "query-tooltip",
+ G_CALLBACK (query_tooltip_cb), this);
+ }
}
virtual void setModel (GtkTreeModel *model)
@@ -496,29 +508,34 @@
gtk_tree_view_scroll_to_cell (view, path, NULL, FALSE, 0, 0);
}
-#if 0
- static gboolean query_tooltip_cb (GtkWidget *view, gint x, gint y,
- gboolean keyboard_mode, GtkTooltip *tooltip, gpointer data)
- {
- GtkTreeModel *model;
- GtkTreePath *path;
- GtkTreeIter iter;
- if (gtk_tree_view_get_tooltip_context (GTK_TREE_VIEW (view),
- &x, &y, keyboard_mode, &model, &path, &iter)) {
- gchar *tooltip_str;
- gtk_tree_model_get (model, &iter, TOOLTIP_TEXT_COL,
- &tooltip_str, -1);
- gtk_tree_view_set_tooltip_row (GTK_TREE_VIEW (view), tooltip, path);
- gtk_tree_path_free (path);
- if (tooltip_str) {
- gtk_tooltip_set_text (tooltip, tooltip_str);
- g_free (tooltip_str);
- return TRUE;
+ static gboolean query_tooltip_cb (GtkWidget *view, gint x, gint y,
+ gboolean keyboard_mode, GtkTooltip *tooltip, gpointer data)
+ {
+ GtkTreeModel *model;
+ GtkTreePath *path;
+ GtkTreeIter iter;
+ if (gtk_tree_view_get_tooltip_context (GTK_TREE_VIEW (view),
+ &x, &y, keyboard_mode, &model, &path, &iter)) {
+ Ypp::Package *package = 0;
+ gtk_tree_model_get (model, &iter,
+ YGtkZyppModel::PTR_COLUMN, &package, -1);
+ gtk_tree_view_set_tooltip_row (GTK_TREE_VIEW (view), tooltip, path);
+ gtk_tree_path_free (path);
+ if (package) {
+ gtk_tooltip_set_text (tooltip, package->description().c_str());
+ const std::string &icon = package->icon();
+ if (!icon.empty()) {
+ GdkPixbuf *pixbuf = loadThemeIcon (icon.c_str(), 32);
+ if (pixbuf) {
+ gtk_tooltip_set_icon (tooltip, pixbuf);
+ g_object_unref (G_OBJECT (pixbuf));
+ }
}
+ return TRUE;
}
- return FALSE;
}
-#endif
+ return FALSE;
+ }
};
struct IconView : public View
{
@@ -725,10 +742,6 @@
gtk_box_pack_start (GTK_BOX (m_box), m_button, FALSE, FALSE, 0);
gtk_widget_show_all (m_box);
modified (package);
- g_signal_connect (G_OBJECT (m_label), "style-set",
- G_CALLBACK (label_style_set_cb), NULL);
- g_signal_connect (G_OBJECT (m_box), "style-set",
- G_CALLBACK (box_style_set_cb), NULL);
g_signal_connect (G_OBJECT (m_button), "clicked",
G_CALLBACK (undo_clicked_cb), package);
}
@@ -771,24 +784,9 @@
{
package->undo();
}
-
- static void label_style_set_cb (GtkWidget *widget, GtkStyle *prev_style)
- {
- static bool safeguard = false;
- if (safeguard) return;
- safeguard = true;
- GdkColor *color = &widget->style->fg [GTK_STATE_SELECTED];
- gtk_widget_modify_fg (widget, GTK_STATE_NORMAL, color);
- safeguard = false;
- }
- static void box_style_set_cb (GtkWidget *widget, GtkStyle *prev_style)
- {
- int width = YGUtils::getCharsWidth (widget, 25);
- gtk_widget_set_size_request (widget, width, -1);
- }
};
-GtkWidget *m_box, *m_entries_box, *m_container;
+GtkWidget *m_box, *m_entries_box;
Ypp::Pool *m_pool;
GList *m_entries;
YGtkWizard *m_wizard;
@@ -798,13 +796,11 @@
{ return m_box; }
ChangesPane (YGtkWizard *wizard, bool update_mode, bool summary_mode)
- : m_container (NULL), m_entries (NULL), m_wizard (wizard)
+ : m_entries (NULL), m_wizard (wizard)
{
GtkWidget *heading = gtk_label_new (_("Changes:"));
- YGUtils::setWidgetFont (heading, PANGO_WEIGHT_ULTRABOLD, PANGO_SCALE_LARGE);
+ YGUtils::setWidgetFont (heading, PANGO_WEIGHT_BOLD, PANGO_SCALE_MEDIUM);
gtk_misc_set_alignment (GTK_MISC (heading), 0, 0.5);
- g_signal_connect (G_OBJECT (heading), "style-set",
- G_CALLBACK (Entry::label_style_set_cb), NULL);
m_entries_box = gtk_vbox_new (FALSE, 4);
GtkWidget *scroll = gtk_scrolled_window_new (NULL, NULL);
@@ -820,12 +816,14 @@
gtk_box_pack_start (GTK_BOX (vbox), heading, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), scroll, TRUE, TRUE, 0);
- m_box = gtk_event_box_new();
+ int width = YGUtils::getCharsWidth (vbox, 25);
+ gtk_widget_set_size_request (vbox, width, -1);
+ gtk_widget_show_all (vbox);
+
+ m_box = ygtk_handle_box_new();
gtk_container_add (GTK_CONTAINER (m_box), vbox);
- g_signal_connect_after (G_OBJECT (m_box), "style-set",
- G_CALLBACK (style_set_cb), NULL);
- g_signal_connect_after (G_OBJECT (port), "style-set",
- G_CALLBACK (style_set_cb), NULL);
+ gtk_handle_box_set_handle_position (GTK_HANDLE_BOX (m_box), GTK_POS_TOP);
+ gtk_handle_box_set_snap_edge (GTK_HANDLE_BOX (m_box), GTK_POS_RIGHT);
Ypp::QueryPool::Query *query = new Ypp::QueryPool::Query();
query->setIsModified (true);
@@ -846,20 +844,8 @@
g_list_free (m_entries);
}
- void UpdateVisible()
- {
- ygtk_wizard_enable_next_button (m_wizard, m_entries != NULL);
- if (m_container) {
- if (m_entries != NULL)
- gtk_widget_show (m_container);
- else
- gtk_widget_hide (m_container);
- }
- }
-
- void setContainer (GtkWidget *container)
+ void startHack() // call after init, after you did a show_all in the dialog
{
- m_container = container;
UpdateVisible();
// ugly: signal modified for all entries to allow them to hide undo buttons
GList *i;
@@ -869,6 +855,15 @@
((Entry *) i->data)->modified (m_pool->get (it));
}
+ void UpdateVisible()
+ {
+ ygtk_wizard_enable_next_button (m_wizard, m_entries != NULL);
+ if (m_entries != NULL)
+ gtk_widget_show (m_box);
+ else
+ gtk_widget_hide (m_box);
+ }
+
virtual void entryInserted (Ypp::Pool::Iter iter, Ypp::Package *package)
{
Entry *entry = new Entry (package);
@@ -895,16 +890,6 @@
Entry *entry = (Entry *) g_list_nth_data (m_entries, index);
entry->modified (package);
}
-
- static void style_set_cb (GtkWidget *widget, GtkStyle *prev_style)
- {
- static bool safeguard = false;
- if (safeguard) return;
- safeguard = true;
- GdkColor *color = &widget->style->bg [GTK_STATE_SELECTED];
- gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, color);
- safeguard = false;
- }
};
#include "icons/pkg-installed.xpm"
@@ -921,71 +906,189 @@
private:
struct View
{
- virtual GtkWidget *getWidget() = 0;
virtual void writeQuery (Ypp::QueryPool::Query *query) = 0;
Collections::Listener *m_listener;
View (Collections::Listener *listener)
: m_listener (listener)
- {}
+ {
+ m_box = gtk_vbox_new (FALSE, 2);
+ }
virtual ~View() {}
+ GtkWidget *getWidget()
+ { return m_box; }
+
void signalChanged()
{ m_listener->collectionChanged(); }
+
+ protected:
+ GtkWidget *m_box;
};
- struct Categories : public View
+ struct StoreView : public View
{
- GtkWidget *m_scroll, *m_view;
- bool m_alternative; // use second categories...
+ protected:
+ GtkWidget *m_view, *m_scroll;
+ enum Column { TEXT_COL, ICON_COL, ENABLED_COL, PTR_COL, TOTAL_COLS };
+
+ virtual void doBuild (GtkTreeStore *store) = 0;
+ virtual void writeQuery (Ypp::QueryPool::Query *query,
+ const std::list <gpointer> &ptr) = 0;
+
public:
- virtual GtkWidget *getWidget()
- { return m_scroll; }
+ StoreView (Collections::Listener *listener)
+ : View (listener)
+ {
+ m_scroll = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (m_scroll),
+ GTK_SHADOW_IN);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (m_scroll),
+ GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+ m_view = NULL;
+
+ gtk_box_pack_start (GTK_BOX (m_box), m_scroll, TRUE, TRUE, 0);
+
+ // parent constructor should call build()
+ }
- Categories (Collections::Listener *listener, Ypp::Package::Type type, bool alternative)
- : View (listener), m_alternative (alternative)
+ void build (bool tree_mode, bool with_icons, bool multi_selection)
{
- GtkTreeViewColumn *column;
- GtkCellRenderer *renderer;
+ if (m_view)
+ gtk_container_remove (GTK_CONTAINER (m_scroll), m_view);
m_view = gtk_tree_view_new();
GtkTreeView *view = GTK_TREE_VIEW (m_view);
gtk_tree_view_set_headers_visible (view, FALSE);
- gtk_tree_view_set_search_column (view, 0);
- renderer = gtk_cell_renderer_pixbuf_new();
- column = gtk_tree_view_column_new_with_attributes ("",
- renderer, "pixbuf", 2, NULL);
- gtk_tree_view_column_set_expand (column, FALSE);
- gtk_tree_view_append_column (view, column);
+ gtk_tree_view_set_search_column (view, TEXT_COL);
+ gtk_tree_view_set_show_expanders (view, tree_mode);
+
+ GtkTreeViewColumn *column;
+ GtkCellRenderer *renderer;
+ if (with_icons) {
+ renderer = gtk_cell_renderer_pixbuf_new();
+ column = gtk_tree_view_column_new_with_attributes ("",
+ renderer, "icon-name", ICON_COL, "sensitive", ENABLED_COL, NULL);
+ gtk_tree_view_append_column (view, column);
+ }
renderer = gtk_cell_renderer_text_new();
+ g_object_set (G_OBJECT (renderer), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
column = gtk_tree_view_column_new_with_attributes ("",
- renderer, "text", 0, NULL);
- gtk_tree_view_column_set_expand (column, TRUE);
+ renderer, "markup", TEXT_COL, "sensitive", ENABLED_COL, NULL);
gtk_tree_view_append_column (view, column);
- if (type != Ypp::Package::PACKAGE_TYPE)
- gtk_tree_view_set_show_expanders (view, FALSE);
- else
- gtk_tree_view_set_expander_column (view, column);
+
+ GtkTreeStore *store = gtk_tree_store_new (TOTAL_COLS,
+ G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_POINTER);
+ GtkTreeModel *model = GTK_TREE_MODEL (store);
+ gtk_tree_view_set_model (view, model);
+ g_object_unref (G_OBJECT (model));
GtkTreeSelection *selection = gtk_tree_view_get_selection (view);
- gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
+ gtk_tree_selection_set_mode (selection,
+ multi_selection ? GTK_SELECTION_MULTIPLE : GTK_SELECTION_BROWSE);
g_signal_connect (G_OBJECT (selection), "changed",
G_CALLBACK (selection_cb), this);
+ gtk_tree_selection_set_select_function (selection, can_select_cb, this, NULL);
+
+ block();
+ GtkTreeIter iter;
+ gtk_tree_store_append (store, &iter, NULL);
+ gtk_tree_store_set (store, &iter, TEXT_COL, _("All"), ENABLED_COL, TRUE, -1);
+ doBuild (store);
+
+ selectFirstItem();
+ unblock();
- m_scroll = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (m_scroll),
- GTK_SHADOW_IN);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (m_scroll),
- GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (m_scroll), m_view);
+ gtk_widget_show (m_view);
+ }
- build (type);
+ void block()
+ {
+ GtkTreeView *view = GTK_TREE_VIEW (m_view);
+ GtkTreeSelection *selection = gtk_tree_view_get_selection (view);
+ g_signal_handlers_block_by_func (selection, (gpointer) selection_cb, this);
+ }
+ void unblock()
+ {
+ GtkTreeView *view = GTK_TREE_VIEW (m_view);
+ GtkTreeSelection *selection = gtk_tree_view_get_selection (view);
+ g_signal_handlers_unblock_by_func (selection, (gpointer) selection_cb, this);
}
- void build (Ypp::Package::Type type)
+ void selectFirstItem()
{
- GtkTreeModel *model = NULL;
+ /* we use gtk_tree_view_set_cursor(), rather than gtk_tree_selection_select_iter()
+ because that one is buggy in that when the user first interacts with the
+ treeview, a change signal is sent, even if he was just expanding one node... */
+ block();
+ GtkTreePath *path = gtk_tree_path_new_first();
+ gtk_tree_view_set_cursor (GTK_TREE_VIEW (m_view), path, NULL, FALSE);
+ gtk_tree_path_free (path);
+ unblock();
+ }
+ static void selection_cb (GtkTreeSelection *selection, StoreView *pThis)
+ {
+ pThis->signalChanged();
+ // if item unselected, make sure "All" is
+ if (gtk_tree_selection_count_selected_rows (selection) == 0)
+ pThis->selectFirstItem();
+ }
+
+ static gboolean can_select_cb (GtkTreeSelection *selection, GtkTreeModel *model,
+ GtkTreePath *path, gboolean currently_selected,
+ gpointer pData)
+ {
+ gboolean ret;
+ GtkTreeIter iter;
+ gtk_tree_model_get_iter (model, &iter, path);
+ gtk_tree_model_get (model, &iter, ENABLED_COL, &ret, -1);
+ return ret;
+ }
+
+ virtual void writeQuery (Ypp::QueryPool::Query *query)
+ {
+ GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (m_view));
+ GtkTreeModel *model;
+ GList *selected = gtk_tree_selection_get_selected_rows (selection, &model);
+ std::list <gpointer> ptrs;
+ for (GList *i = selected; i; i = i->next) {
+ GtkTreePath *path = (GtkTreePath *) i->data;
+ GtkTreeIter iter;
+ gtk_tree_model_get_iter (model, &iter, path);
+ gpointer ptr;
+ gtk_tree_model_get (model, &iter, PTR_COL, &ptr, -1);
+ if (ptr)
+ ptrs.push_back (ptr);
+ gtk_tree_path_free (path);
+ }
+ g_list_free (selected);
+ writeQuery (query, ptrs);
+ }
+ };
+
+ struct Categories : public StoreView
+ {
+ bool m_patchMode, m_rpmGroups;
+ public:
+ Categories (Collections::Listener *listener, bool patch_mode)
+ : StoreView (listener), m_patchMode (patch_mode), m_rpmGroups (false)
+ {
+ GtkWidget *check = gtk_check_button_new_with_label (_("Detailed"));
+ YGUtils::setWidgetFont (GTK_BIN (check)->child,
+ PANGO_WEIGHT_NORMAL, PANGO_SCALE_SMALL);
+ gtk_widget_set_tooltip_text (check,
+ _("Group by the PackageKit-based filter or straight from the actual "
+ "RPM information."));
+ g_signal_connect (G_OBJECT (check), "toggled",
+ G_CALLBACK (rpm_groups_toggled_cb), this);
+ gtk_box_pack_start (GTK_BOX (m_box), check, FALSE, TRUE, 0);
+ build (m_rpmGroups, !m_rpmGroups, false);
+ }
+
+ virtual void doBuild (GtkTreeStore *store)
+ {
struct inner {
static void populate (GtkTreeStore *store, GtkTreeIter *parent,
Ypp::Node *category, Categories *pThis)
@@ -994,136 +1097,143 @@
return;
GtkTreeIter iter;
gtk_tree_store_append (store, &iter, parent);
- const std::string &name = category->name;
- const char *icon = category->icon;
- gtk_tree_store_set (store, &iter, 0, name.c_str(), 1, category, -1);
- if (icon) {
- GdkPixbuf *pixbuf = loadThemeIcon (icon);
- gtk_tree_store_set (store, &iter, 2, pixbuf, -1);
- if (pixbuf)
- g_object_unref (G_OBJECT (pixbuf));
- }
+ gtk_tree_store_set (store, &iter, TEXT_COL, category->name.c_str(),
+ ICON_COL, category->icon, PTR_COL, category, ENABLED_COL, TRUE, -1);
populate (store, &iter, category->child(), pThis);
populate (store, parent, category->next(), pThis);
}
- static GdkPixbuf *loadThemeIcon (const char *icon)
- {
- GtkIconTheme *icons = gtk_icon_theme_get_default();
- GdkPixbuf *pixbuf = gtk_icon_theme_load_icon (icons, icon, 22,
- GtkIconLookupFlags (0), NULL);
- return pixbuf;
- }
};
- GtkTreeStore *store = gtk_tree_store_new (3, G_TYPE_STRING, G_TYPE_POINTER,
- GDK_TYPE_PIXBUF);
- model = GTK_TREE_MODEL (store);
-
- GtkTreeView *view = GTK_TREE_VIEW (m_view);
- GtkTreeSelection *selection = gtk_tree_view_get_selection (view);
-
- g_signal_handlers_block_by_func (selection, (gpointer) selection_cb, this);
-
- GtkTreeIter iter;
- gtk_tree_store_append (store, &iter, NULL);
- gtk_tree_store_set (store, &iter, 0, _("All"), 1, NULL, -1);
-
Ypp::Node *first_category;
- if (m_alternative)
+ Ypp::Package::Type type =
+ m_patchMode ? Ypp::Package::PATCH_TYPE : Ypp::Package::PACKAGE_TYPE;
+ if (!m_rpmGroups)
first_category = Ypp::get()->getFirstCategory2 (type);
else
first_category = Ypp::get()->getFirstCategory (type);
inner::populate (store, NULL, first_category, this);
- if (m_alternative) {
+ if (!m_rpmGroups) {
+ GtkTreeView *view = GTK_TREE_VIEW (m_view);
+ GtkTreeIter iter;
gtk_tree_store_append (store, &iter, NULL);
- gtk_tree_store_set (store, &iter, 0, NULL, -1);
gtk_tree_view_set_row_separator_func (view,
is_tree_model_iter_separator_cb, NULL, NULL);
- GdkPixbuf *pixbuf = inner::loadThemeIcon (GTK_STOCK_ABOUT);
gtk_tree_store_append (store, &iter, NULL);
- gtk_tree_store_set (store, &iter, 0, _("Recommended"),
- 1, GINT_TO_POINTER (1), 2, pixbuf, -1);
+ gtk_tree_store_set (store, &iter, TEXT_COL, _("Recommended"),
+ ICON_COL, GTK_STOCK_ABOUT, PTR_COL, GINT_TO_POINTER (1),
+ ENABLED_COL, TRUE, -1);
gtk_tree_store_append (store, &iter, NULL);
- gtk_tree_store_set (store, &iter, 0, _("Suggested"),
- 1, GINT_TO_POINTER (2), 2, pixbuf, -1);
- g_object_unref (G_OBJECT (pixbuf));
- gtk_tree_view_set_show_expanders (view, FALSE);
+ gtk_tree_store_set (store, &iter, TEXT_COL, _("Suggested"),
+ ICON_COL, GTK_STOCK_ABOUT, PTR_COL, GINT_TO_POINTER (2),
+ ENABLED_COL, TRUE, -1);
}
+ }
- gtk_tree_view_set_model (view, model);
- g_object_unref (G_OBJECT (model));
- selectFirstItem();
-
- g_signal_handlers_unblock_by_func (selection, (gpointer) selection_cb, this);
+ virtual void writeQuery (Ypp::QueryPool::Query *query,
+ const std::list <gpointer> &ptrs)
+ {
+ if (ptrs.empty())
+ return;
+ gpointer ptr = ptrs.front();
+ if (GPOINTER_TO_INT (ptr) == 1)
+ query->setIsRecommended (true);
+ else if (GPOINTER_TO_INT (ptr) == 2)
+ query->setIsSuggested (true);
+ else {
+ Ypp::Node *node = (Ypp::Node *) ptr;
+ if (m_rpmGroups)
+ query->addCategory (node);
+ else
+ query->addCategory2 (node);
+ }
}
- void selectFirstItem()
+ static void rpm_groups_toggled_cb (GtkToggleButton *button, Categories *pThis)
{
- GtkTreeView *view = GTK_TREE_VIEW (m_view);
- GtkTreeSelection *selection = gtk_tree_view_get_selection (view);
-
- g_signal_handlers_block_by_func (selection, (gpointer) selection_cb, this);
-
- /* we use gtk_tree_view_set_cursor(), rather than gtk_tree_selection_select_iter()
- because that one is buggy in that when the user first interacts with the treeview,
- a change signal is sent, even if he was just expanding one node... */
- GtkTreePath *path = gtk_tree_path_new_first();
- gtk_tree_view_set_cursor (view, path, NULL, FALSE);
- gtk_tree_path_free (path);
-
- g_signal_handlers_unblock_by_func (selection, (gpointer) selection_cb, this);
+ pThis->m_rpmGroups = gtk_toggle_button_get_active (button);
+ pThis->build (pThis->m_rpmGroups, !pThis->m_rpmGroups, false);
+ pThis->signalChanged();
}
+ };
- static void selection_cb (GtkTreeSelection *selection, Categories *pThis)
+ struct Repositories : public StoreView
+ {
+ public:
+ Repositories (Collections::Listener *listener)
+ : StoreView (listener)
{
- pThis->signalChanged();
+ GtkWidget *align, *button, *box, *image, *label;
+ image = gtk_image_new_from_stock (GTK_STOCK_EDIT, GTK_ICON_SIZE_MENU);
+ label = gtk_label_new (_("Edit..."));
+ YGUtils::setWidgetFont (label, PANGO_WEIGHT_NORMAL, PANGO_SCALE_SMALL);
+ box = gtk_hbox_new (FALSE, 6);
+ gtk_box_pack_start (GTK_BOX (box), image, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 0);
+ button = gtk_button_new();
+ gtk_container_add (GTK_CONTAINER (button), box);
+ align = gtk_alignment_new (0, 0, 0, 1);
+ gtk_container_add (GTK_CONTAINER (align), button);
+ g_signal_connect (G_OBJECT (button), "clicked",
+ G_CALLBACK (setup_button_clicked_cb), this);
+ gtk_box_pack_start (GTK_BOX (m_box), align, FALSE, TRUE, 0);
+ build (false, true, true);
+ }
- // if item unselected, make sure "All" is
- if (!gtk_tree_selection_get_selected (selection, NULL, NULL))
- pThis->selectFirstItem();
+ virtual ~Repositories()
+ {
+ Ypp::get()->setFavoriteRepository (NULL);
}
- virtual void writeQuery (Ypp::QueryPool::Query *query)
+ virtual void doBuild (GtkTreeStore *store)
{
- Ypp::Node *node = 0;
- GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (m_view));
- GtkTreeModel *model;
GtkTreeIter iter;
- if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
- gpointer ptr;
- gtk_tree_model_get (model, &iter, 1, &ptr, -1);
- if (GPOINTER_TO_INT (ptr) == 1)
- query->setIsRecommended (true);
- else if (GPOINTER_TO_INT (ptr) == 2)
- query->setIsSuggested (true);
+ for (int i = 0; Ypp::get()->getRepository (i); i++) {
+ const Ypp::Repository *repo = Ypp::get()->getRepository (i);
+ gtk_tree_store_append (store, &iter, NULL);
+ std::string text = repo->name + "\n<small>" + repo->url + "</small>";
+ const gchar *icon;
+ if (repo->url.empty())
+ icon = GTK_STOCK_MISSING_IMAGE;
+ else if (repo->url.compare (0, 2, "cd", 2) == 0 ||
+ repo->url.compare (0, 3, "dvd", 3) == 0 ||
+ repo->url.compare (0, 3, "iso", 3) == 0)
+ icon = GTK_STOCK_CDROM;
else
- node = (Ypp::Node *) ptr;
+ icon = GTK_STOCK_NETWORK;
+ gtk_tree_store_set (store, &iter, TEXT_COL, text.c_str(),
+ ICON_COL, icon, ENABLED_COL, repo->enabled, PTR_COL, repo, -1);
}
- if (node) {
- if (m_alternative)
- query->addCategory2 (node);
- else
- query->addCategory (node);
+ }
+
+ virtual void writeQuery (Ypp::QueryPool::Query *query,
+ const std::list <gpointer> &ptrs)
+ {
+ for (std::list <gpointer>::const_iterator it = ptrs.begin();
+ it != ptrs.end(); it++) {
+ Ypp::Repository *repo = (Ypp::Repository *) *it;
+ query->addRepository (repo);
}
+ gpointer ptr = ptrs.size() == 1 ? ptrs.front() : NULL;
+ Ypp::get()->setFavoriteRepository ((Ypp::Repository *) ptr);
+ }
+
+ static void setup_button_clicked_cb (GtkButton *button, Repositories *pThis)
+ {
+ YGUI::ui()->sendEvent (new YMenuEvent ("repo_mgr"));
}
};
struct Pool : public View, public PackagesView::Listener
{
+ private:
PackagesView * m_view;
- GtkWidget *m_box, *m_buttons_box;
- Ypp::Package::Type m_type;
+ GtkWidget *m_buttons_box;
public:
- virtual GtkWidget *getWidget()
- { return m_box; }
-
Pool (Collections::Listener *listener, Ypp::Package::Type type)
: View (listener)
{
- m_type = type;
-
m_view = new PackagesView (true);
m_view->setPool (new Ypp::TreePool (type));
m_view->setListener (this);
@@ -1146,7 +1256,6 @@
gtk_widget_set_sensitive (m_buttons_box, FALSE);
// layout
- m_box = gtk_vbox_new (FALSE, 4);
gtk_box_pack_start (GTK_BOX (m_box), m_view->getWidget(), TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (m_box), m_buttons_box, FALSE, TRUE, 0);
}
@@ -1187,7 +1296,9 @@
GtkWidget *m_bin;
Collections::Listener *m_listener;
- public:
+public:
+ enum Type { GROUPS_TYPE, PATTERNS_TYPE, REPOS_TYPE };
+
Collections (Collections::Listener *listener)
: m_view (NULL), m_listener (listener)
{
@@ -1202,7 +1313,7 @@
GtkWidget *getWidget()
{ return m_bin; }
- void setType (Ypp::Package::Type type, bool alternative = false)
+ void setType (Type type, bool patch_mode)
{
if (m_view)
gtk_container_remove (GTK_CONTAINER (m_bin), m_view->getWidget());
@@ -1210,16 +1321,14 @@
switch (type)
{
- case Ypp::Package::PACKAGE_TYPE:
- case Ypp::Package::PATCH_TYPE:
- m_view = new Categories (m_listener, type, alternative);
+ case GROUPS_TYPE:
+ m_view = new Categories (m_listener, patch_mode);
break;
- case Ypp::Package::PATTERN_TYPE:
- //case Ypp::Package::LANGUAGE_TYPE:
- m_view = new Pool (m_listener, type);
+ case PATTERNS_TYPE:
+ m_view = new Pool (m_listener, Ypp::Package::PATTERN_TYPE);
break;
default:
- m_view = NULL;
+ m_view = new Repositories (m_listener);
break;
}
@@ -1260,16 +1369,16 @@
GtkWidget *button;
GSList *group;
- button = createButton (_("Available"), pkg_available_xpm, NULL);
+ button = createButton (_("_Available"), pkg_available_xpm, NULL);
group = ygtk_toggle_button_get_group (YGTK_TOGGLE_BUTTON (button));
gtk_box_pack_start (GTK_BOX (m_box), button, TRUE, TRUE, 0);
if (!updateMode) {
- button = createButton (_("Upgrades"), pkg_installed_upgradable_xpm, group);
+ button = createButton (_("_Upgrades"), pkg_installed_upgradable_xpm, group);
gtk_box_pack_start (GTK_BOX (m_box), button, TRUE, TRUE, 0);
}
- button = createButton (_("Installed"), pkg_installed_xpm, group);
+ button = createButton (_("_Installed"), pkg_installed_xpm, group);
gtk_box_pack_start (GTK_BOX (m_box), button, TRUE, TRUE, 0);
- button = createButton (_("All"), 0, group);
+ button = createButton (_("A_ll"), 0, group);
gtk_box_pack_start (GTK_BOX (m_box), button, FALSE, TRUE, 0);
}
@@ -1281,10 +1390,12 @@
GtkWidget *createButton (const char *label, const char **xpm, GSList *group)
{
GtkWidget *button = ygtk_toggle_button_new (group);
+ gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
if (xpm)
gtk_box_pack_start (GTK_BOX (hbox), createImageFromXPM (xpm), FALSE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (label), TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox),
+ gtk_label_new_with_mnemonic (label), TRUE, TRUE, 0);
gtk_container_add (GTK_CONTAINER (button), hbox);
if (!group)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
@@ -1312,86 +1423,65 @@
private:
Collections *m_collection;
StatusButtons *m_statuses;
- GtkWidget *m_name, *m_repos, *m_type;
+ GtkWidget *m_name, *m_type;
Listener *m_listener;
guint timeout_id;
bool m_updateMode, m_enableRepoMgr;
- enum PaneType { GROUPS_TYPE, CATEGORIES_TYPE, PATTERNS_TYPE };
- int m_selectedType;
-
public:
GtkWidget *getCollectionWidget() { return m_collection->getWidget(); }
GtkWidget *getStatusesWidget() { return m_statuses->getWidget(); }
GtkWidget *getNameWidget() { return m_name; }
- GtkWidget *getReposWidget() { return m_repos; }
GtkWidget *getTypeWidget() { return m_type; }
Filters (bool updateMode, bool enableRepoMgr)
: m_listener (NULL), timeout_id (0), m_updateMode (updateMode),
- m_enableRepoMgr (enableRepoMgr), m_selectedType (-1)
+ m_enableRepoMgr (enableRepoMgr)
{
- m_collection = new Collections (this);
m_statuses = new StatusButtons (this, updateMode);
m_name = ygtk_find_entry_new();
gtk_widget_set_tooltip_markup (m_name,
_("<b>Package search:</b> Use spaces to separate your keywords. They "
- "will be matched against RPM <i>name</i>, <i>summary</i> and "
- "<i>provides</i> attributes.\n(e.g.: \"yast dhcp\" will return yast's "
- "dhcpd tool)"));
+ "will be matched against RPM <i>name</i> and <i>summary</i> attributes. "
+ "Further attributes can be included in the criteria by pressing the search icon.\n"
+ "(usage example: \"yast dhcp\" will return yast's dhcpd tool)"));
g_signal_connect (G_OBJECT (m_name), "changed",
- G_CALLBACK (entry_changed_cb), this);
+ G_CALLBACK (field_changed_cb), this);
- m_repos = gtk_combo_box_new();
- gtk_widget_set_tooltip_markup (m_repos,
- _("<b>Package repositories:</b> Limits the query to one repository.\n"
- "You can add or remove them through the YaST control center or by "
- "selecting the respective option."));
- GtkListStore *store = gtk_list_store_new (1, G_TYPE_STRING);
- gtk_combo_box_set_model (GTK_COMBO_BOX (m_repos), GTK_TREE_MODEL (store));
- g_object_unref (G_OBJECT (store));
- GtkCellRenderer *renderer = gtk_cell_renderer_text_new();
- gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (m_repos), renderer, TRUE);
- gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (m_repos), renderer,
- "markup", 0, NULL);
- g_object_set (G_OBJECT (renderer), "width-chars", 25,
- "ellipsize", PANGO_ELLIPSIZE_MIDDLE, NULL);
- GtkTreeIter iter;
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter, 0, _("All Repositories"), -1);
- for (int i = 0; Ypp::get()->getRepository (i); i++) {
- const Ypp::Repository *repo = Ypp::get()->getRepository (i);
- gtk_list_store_append (store, &iter);
- std::string str = " " + repo->name;
- gtk_list_store_set (store, &iter, 0, str.c_str(), -1);
- }
- if (enableRepoMgr) {
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter, 0, NULL, -1);
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter, 0, _("Add or Remove..."), -1);
- }
- gtk_combo_box_set_active (GTK_COMBO_BOX (m_repos), 0);
- gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (m_repos),
- is_tree_model_iter_separator_cb, NULL, NULL);
- g_signal_connect_after (G_OBJECT (m_repos), "changed",
- G_CALLBACK (combo_changed_cb), this);
+ struct inner {
+ static void appendCheckItem (GtkWidget *menu, const char *str, bool active,
+ Filters *pThis)
+ {
+ GtkWidget *item = gtk_check_menu_item_new_with_label (str);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), active);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+ g_signal_connect (G_OBJECT (item), "toggled",
+ G_CALLBACK (field_changed_cb), pThis);
+ }
+ };
+
+ GtkWidget *name_menu = gtk_menu_new();
+ inner::appendCheckItem (name_menu, _("Name"), true, this);
+ inner::appendCheckItem (name_menu, _("Summary"), true, this);
+ inner::appendCheckItem (name_menu, _("Description"), false, this);
+ gtk_widget_show_all (name_menu);
+ ygtk_find_entry_attach_menu (YGTK_FIND_ENTRY (m_name), GTK_MENU (name_menu));
m_type = gtk_combo_box_new_text();
if (updateMode)
gtk_combo_box_append_text (GTK_COMBO_BOX (m_type), _("Patches"));
else {
gtk_combo_box_append_text (GTK_COMBO_BOX (m_type), _("Groups"));
- gtk_combo_box_append_text (GTK_COMBO_BOX (m_type), _("Categories"));
gtk_combo_box_append_text (GTK_COMBO_BOX (m_type), _("Patterns"));
-#if 0
- gtk_combo_box_append_text (GTK_COMBO_BOX (m_type), _("Languages"));
-#endif
+ gtk_combo_box_append_text (GTK_COMBO_BOX (m_type), _("Repositories"));
}
gtk_combo_box_set_active (GTK_COMBO_BOX (m_type), 0);
g_signal_connect_after (G_OBJECT (m_type), "changed",
- G_CALLBACK (combo_changed_cb), this);
+ G_CALLBACK (type_changed_cb), this);
+
+ m_collection = new Collections (this);
+ m_collection->setType (Collections::GROUPS_TYPE, updateMode);
}
~Filters()
@@ -1400,70 +1490,47 @@
g_source_remove (timeout_id);
}
-public:
- const Ypp::Repository *selectedRepo()
+private:
+ static void type_changed_cb (GtkComboBox *combo, Filters *pThis)
{
- GtkComboBox *combo = GTK_COMBO_BOX (m_repos);
- int repo = gtk_combo_box_get_active (combo);
-
- if (m_enableRepoMgr) {
- GtkTreeModel *model = gtk_combo_box_get_model (combo);
- int setup_id = gtk_tree_model_iter_n_children (model, NULL);
- if (repo == setup_id-1) {
- YGUI::ui()->sendEvent (new YMenuEvent ("repo_mgr"));
- repo = 0;
- }
- }
-
- const Ypp::Repository *ret = 0;
- if (repo > 0)
- ret = Ypp::get()->getRepository (repo-1);
- Ypp::get()->setFavoriteRepository (ret);
- return ret;
+ int type = gtk_combo_box_get_active (combo);
+ if (pThis->m_updateMode && type == 1)
+ type = Collections::REPOS_TYPE;
+ pThis->m_collection->setType ((Collections::Type) type, pThis->m_updateMode);
+ pThis->signalChangedDelay();
}
-private:
- static void entry_changed_cb (GtkEditable *editable, Filters *pThis)
+ static void field_changed_cb (gpointer widget, Filters *pThis)
{ pThis->signalChangedDelay(); }
- static void combo_changed_cb (GtkComboBox *combo, Filters *pThis)
- { pThis->signalChanged(); }
virtual void collectionChanged()
{ signalChanged(); }
void signalChanged()
{
if (!m_listener) return;
-
- PaneType t = (PaneType) gtk_combo_box_get_active (GTK_COMBO_BOX (m_type));
- bool alternative = false;
- Ypp::Package::Type type;
- if (m_updateMode)
- type = Ypp::Package::PATCH_TYPE;
- else {
- if (t == PATTERNS_TYPE)
- type = Ypp::Package::PATTERN_TYPE;
- else {
- type = Ypp::Package::PACKAGE_TYPE;
- alternative = t == GROUPS_TYPE;
- }
- }
-
- // adjust interface
- if (t != m_selectedType) {
- m_collection->setType (type, alternative);
- m_selectedType = t;
- }
+ busyCursor();
// create query
Ypp::QueryPool::Query *query = new Ypp::QueryPool::Query();
- if (type == Ypp::Package::PATCH_TYPE)
+ if (m_updateMode)
query->addType (Ypp::Package::PATCH_TYPE);
else
query->addType (Ypp::Package::PACKAGE_TYPE);
const char *name = gtk_entry_get_text (GTK_ENTRY (m_name));
- if (*name)
- query->addNames (name, ' ');
+ if (*name) {
+ bool use_name, use_summary, use_description;
+ GtkMenu *name_menu = YGTK_FIND_ENTRY (m_name)->context_menu;
+ GList *items = gtk_container_get_children (GTK_CONTAINER (name_menu));
+ use_name = gtk_check_menu_item_get_active (
+ (GtkCheckMenuItem *) g_list_nth_data (items, 0));
+ use_summary = gtk_check_menu_item_get_active (
+ (GtkCheckMenuItem *) g_list_nth_data (items, 1));
+ use_description = gtk_check_menu_item_get_active (
+ (GtkCheckMenuItem *) g_list_nth_data (items, 2));
+ g_list_free (items);
+ query->addNames (name, ' ', use_name, use_summary, use_description);
+ }
switch (m_statuses->getActive())
{
@@ -1486,9 +1553,7 @@
m_collection->writeQuery (query);
- if (selectedRepo())
- query->addRepository (selectedRepo());
-
+ normalCursor();
m_listener->doQuery (query);
}
@@ -1615,9 +1680,11 @@
if (packages.installed()) {
gtk_widget_show (m_installed_box);
- if (single_package)
- gtk_label_set_text (GTK_LABEL (m_installed_version),
- single_package->getInstalledVersion()->number.c_str());
+ if (single_package) {
+ std::string version = single_package->getInstalledVersion()->number;
+ version += " <small>(" + single_package->getInstalledVersion()->arch + ")</small>";
+ gtk_label_set_markup (GTK_LABEL (m_installed_version), version.c_str());
+ }
else
gtk_label_set_text (GTK_LABEL (m_installed_version), "(several)");
}
@@ -1634,20 +1701,18 @@
if (single_package->getAvailableVersion (0)) {
gtk_widget_set_sensitive (m_available_versions, TRUE);
gtk_widget_show (m_available_box);
- const Ypp::Repository *selectedRepo = m_filters->selectedRepo();
+ const Ypp::Repository *favoriteRepo = Ypp::get()->favoriteRepository();
for (int i = 0; single_package->getAvailableVersion (i); i++) {
const Ypp::Package::Version *version = single_package->getAvailableVersion (i);
- string text = version->number + "\n";
+ string text = version->number + " <small>(" + version->arch + "</small>)\n";
string repo = YGUtils::truncate (version->repo->name,
- MAX (20, version->number.length()), 0);
- text += "<i>" + repo + "</i>";
+ MAX (20, version->number.length() + version->arch.length() + 4), 0);
+ text += "<small>" + repo + "</small>";
GtkTreeIter iter;
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, text.c_str(), -1);
- if (selectedRepo && version->repo == selectedRepo) {
+ if (version->repo == favoriteRepo)
gtk_combo_box_set_active (GTK_COMBO_BOX (m_available_versions), i);
- gtk_widget_set_sensitive (m_available_versions, FALSE);
- }
else if (i == 0)
gtk_combo_box_set_active (GTK_COMBO_BOX (m_available_versions), 0);
}
@@ -1749,14 +1814,14 @@
version = package->getAvailableVersion (nb);
assert (version != NULL);
- const char *installLabel = _("_Install");
+ const char *installLabel = _("Ins_tall");
if (package->isInstalled()) {
if (version->cmp > 0)
- installLabel = _("_Upgrade");
+ installLabel = _("Up_grade");
else if (version->cmp == 0)
- installLabel = _("_Re-install");
+ installLabel = _("Re-ins_tall");
else //if (version->cmp < 0)
- installLabel = _("_Downgrade");
+ installLabel = _("Down_grade");
}
gtk_button_set_label (GTK_BUTTON (pThis->m_install_button), installLabel);
}
@@ -1836,14 +1901,13 @@
std::string requires_str = _("Requires:");
std::string provides_str = _("Provides:");
requires_str += "<br><blockquote>";
- provides_str += "<br><blockquote>";
requires_str += package->requires();
- provides_str += package->provides();
- YGUtils::replace (requires_str, "\n", 1, "<br>");
YGUtils::replace (provides_str, "\n", 1, "<br>");
requires_str += "</blockquote>";
+ provides_str += "<br><blockquote>";
+ provides_str += package->provides();
+ YGUtils::replace (requires_str, "\n", 1, "<br>");
provides_str += "</blockquote>";
-
ygtk_html_wrap_set_text (requires, requires_str.c_str(), FALSE);
ygtk_html_wrap_set_text (provides, provides_str.c_str(), FALSE);
gtk_widget_show (expander);
@@ -2103,7 +2167,7 @@
long usage = (part->used * 100) / (part->total + 1);
bool full = usage > MIN_PERCENT_WARN && (part->total - part->used) < MIN_FREE_MB_WARN;
- std::string usage_str = part->used_str + " / " + part->total_str;
+ std::string usage_str = part->used_str + _(" of ") + part->total_str;
if (full)
warn = true;
@@ -2222,7 +2286,7 @@
gtk_widget_show_all (item);
}
#endif
- ygtk_menu_button_set_popup_align (YGTK_MENU_BUTTON (button), menu, 0.5, 1.0);
+ ygtk_menu_button_set_popup_align (YGTK_MENU_BUTTON (button), menu, 0.0, 1.0);
return button;
}
};
@@ -2230,6 +2294,7 @@
class PackageSelector : public Filters::Listener, public PackagesView::Listener,
public PackageDetails::Listener
{
+friend class YGPackageSelector;
PackagesView *m_packages;
Filters *m_filters;
PackageControl *m_control;
@@ -2255,22 +2320,23 @@
m_filters->setListener (this);
m_details->setListener (this);
- GtkWidget *filter_box = gtk_hbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX (filter_box), gtk_label_new (_("Filters:")), FALSE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (filter_box), m_filters->getNameWidget(), FALSE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (filter_box), m_filters->getReposWidget(), FALSE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (filter_box), gtk_label_new(""), TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (filter_box), m_disk->getWidget(), FALSE, TRUE, 0);
-
- GtkWidget *categories_box = gtk_vbox_new (FALSE, 6);
+ GtkWidget *categories_box = gtk_vbox_new (FALSE, 4);
+ gtk_box_pack_start (GTK_BOX (categories_box), m_filters->getTypeWidget(), FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (categories_box), m_filters->getCollectionWidget(),
TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (categories_box), m_filters->getTypeWidget(), FALSE, TRUE, 0);
- GtkWidget *packages_box = gtk_hpaned_new();
- gtk_paned_pack1 (GTK_PANED (packages_box), categories_box, FALSE, TRUE);
- gtk_paned_pack2 (GTK_PANED (packages_box), m_packages->getWidget(), TRUE, FALSE);
- gtk_paned_set_position (GTK_PANED (packages_box), 180);
+ GtkWidget *packages_label = gtk_label_new_with_mnemonic (_("Packages _listing:"));
+ gtk_label_set_mnemonic_widget (GTK_LABEL (packages_label),
+ GTK_BIN (m_packages->getWidget())->child);
+ gtk_misc_set_alignment (GTK_MISC (packages_label), 0, 0.5);
+
+ GtkWidget *packages_bar = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (packages_bar), packages_label, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (packages_bar), m_filters->getNameWidget(), FALSE, TRUE, 0);
+
+ GtkWidget *packages_box = gtk_vbox_new (FALSE, 4);
+ gtk_box_pack_start (GTK_BOX (packages_box), packages_bar, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (packages_box), m_packages->getWidget(), TRUE, TRUE, 0);
m_details_box = gtk_hbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX (m_details_box), m_details->getWidget(), TRUE, TRUE, 0);
@@ -2281,21 +2347,18 @@
gtk_paned_pack2 (GTK_PANED (packages_pane), m_details_box, FALSE, FALSE);
gtk_paned_set_position (GTK_PANED (packages_pane), 30000 /* minimal size */);
- GtkWidget *vbox = gtk_vbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX (vbox), m_filters->getStatusesWidget(), FALSE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (vbox), filter_box, FALSE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (vbox), packages_pane, TRUE, TRUE, 0);
- gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
-
- GtkWidget *changes_box = gtk_vbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (changes_box), m_changes->getWidget(), TRUE, TRUE, 0);
-
- m_box = gtk_hbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX (m_box), vbox, TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (m_box), changes_box, FALSE, TRUE, 0);
+ GtkWidget *pane = gtk_hpaned_new();
+ gtk_paned_pack1 (GTK_PANED (pane), categories_box, FALSE, TRUE);
+ gtk_paned_pack2 (GTK_PANED (pane), packages_pane, TRUE, FALSE);
+ gtk_paned_set_position (GTK_PANED (pane), 180);
+
+ m_box = gtk_vbox_new (FALSE, 6);
+ gtk_box_pack_start (GTK_BOX (m_box), m_filters->getStatusesWidget(),
+ FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (m_box), pane, TRUE, TRUE, 0);
gtk_widget_show_all (m_box);
- m_changes->setContainer (changes_box);
+ m_changes->startHack();
packagesSelected (PkgList());
gtk_widget_hide (m_details_box);
}
@@ -2351,8 +2414,6 @@
YGWidget (this, parent, true, YGTK_TYPE_WIZARD, NULL)
{
setBorder (0);
- YGTK_WIZARD (getWidget())->child_border_width = 0;
-
GtkWindow *window = YGDialog::currentWindow();
int enlarge_width = MIN (0.95 * YUI::app()->displayWidth(), 650);
int enlarge_height = MIN (0.95 * YUI::app()->displayHeight(), 600);
@@ -2365,29 +2426,32 @@
THEMEDIR "/icons/22x22/apps/yast-software.png");
ygtk_wizard_set_header_text (wizard,
onlineUpdateMode() ? _("Patch Selection") : _("Package Selection"));
+ ygtk_wizard_set_help_text (wizard, _("Please wait..."));
ygtk_wizard_set_abort_button_label (wizard, _("_Cancel"));
ygtk_wizard_set_abort_button_str_id (wizard, "cancel");
ygtk_wizard_set_back_button_label (wizard, "");
- ygtk_wizard_set_next_button_label (wizard, _("_Apply"));
+ ygtk_wizard_set_next_button_label (wizard, _("A_pply"));
ygtk_wizard_set_next_button_str_id (wizard, "accept");
ygtk_wizard_enable_next_button (wizard, FALSE);
g_signal_connect (G_OBJECT (getWidget()), "action-triggered",
G_CALLBACK (wizard_action_cb), this);
busyCursor();
- ygtk_wizard_set_help_text (wizard, onlineUpdateMode() ? _(patch_help) : _(pkg_help));
- createToolsButton();
-
YGDialog *dialog = YGDialog::currentDialog();
dialog->setCloseCallback (confirm_cb, this);
m_package_selector = new PackageSelector (wizard, onlineUpdateMode(),
repoMgrEnabled(), summaryMode());
- gtk_container_add (GTK_CONTAINER (wizard), m_package_selector->getWidget());
+ ygtk_wizard_set_child (YGTK_WIZARD (wizard), m_package_selector->getWidget());
+
+ createToolsButton();
+ ygtk_wizard_set_information_widget (YGTK_WIZARD (wizard),
+ m_package_selector->m_changes->getWidget());
Ypp::get()->setInterface (this);
Ypp::get()->addPkgListener (this);
+ ygtk_wizard_set_help_text (wizard, onlineUpdateMode() ? _(patch_help) : _(pkg_help));
}
virtual ~YGPackageSelector()
@@ -2780,9 +2844,14 @@
G_CALLBACK (inner::create_solver_testcase_cb), this);
ygtk_menu_button_set_popup (YGTK_MENU_BUTTON (button), popup);
- ygtk_wizard_set_extra_button (YGTK_WIZARD (getWidget()), button);
- gtk_widget_show (button);
gtk_widget_show_all (popup);
+
+ GtkWidget *box = gtk_hbox_new (FALSE, 12);
+ gtk_box_pack_start (GTK_BOX (box), button, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (box),
+ m_package_selector->m_disk->getWidget(), FALSE, TRUE, 0);
+ gtk_widget_show_all (box);
+ ygtk_wizard_set_extra_button (YGTK_WIZARD (getWidget()), box);
}
};
Modified: trunk/gtk/src/YGUI.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUI.cc?rev=49531&r1=495…
==============================================================================
--- trunk/gtk/src/YGUI.cc (original)
+++ trunk/gtk/src/YGUI.cc Thu Jul 31 03:36:55 2008
@@ -38,6 +38,12 @@
m_have_wm = true;
m_no_border = m_fullscreen = false;
+ // debug:
+#if 0
+ g_log_set_always_fatal (GLogLevelFlags (G_LOG_LEVEL_ERROR|G_LOG_LEVEL_CRITICAL|
+ G_LOG_LEVEL_WARNING| G_LOG_LEVEL_MESSAGE|G_LOG_LEVEL_INFO|G_LOG_LEVEL_DEBUG));
+#endif
+
YGUI::setTextdomain( TEXTDOMAIN );
// without this none of the (default) threading action works ...
Modified: trunk/gtk/src/YGUtils.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUtils.cc?rev=49531&r1=…
==============================================================================
--- trunk/gtk/src/YGUtils.cc (original)
+++ trunk/gtk/src/YGUtils.cc Thu Jul 31 03:36:55 2008
@@ -427,21 +427,6 @@
void ygutils_setWidgetFont (GtkWidget *widget, PangoWeight weight, double scale)
{ YGUtils::setWidgetFont (widget, weight, scale); }
-std::list <string> YGUtils::splitString (const string &str, char separator)
-{
- std::list <string> parts;
- std::string::size_type i, j;
- // ignore first character, if separator
- i = j = (str[0] == separator) ? 1 : 0;
- for (; i < str.length(); i++)
- if (str[i] == separator) {
- parts.push_back (str.substr (j, i - j));
- j = ++i;
- }
- parts.push_back (str.substr (j));
- return parts;
-}
-
GdkPixbuf *YGUtils::loadPixbuf (const string &filename)
{
GdkPixbuf *pixbuf = NULL;
Modified: trunk/gtk/src/YGUtils.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUtils.h?rev=49531&r1=4…
==============================================================================
--- trunk/gtk/src/YGUtils.h (original)
+++ trunk/gtk/src/YGUtils.h Thu Jul 31 03:36:55 2008
@@ -42,10 +42,6 @@
/* Sets some widget font proprities. */
void setWidgetFont (GtkWidget *widget, PangoWeight weight, double scale);
- /* Splits a string into parts as separated by the separator characters.
- eg: splitString ("Office/Writer", '/') => { "Office", "Writer" } */
- std::list <std::string> splitString (const std::string &str, char separator);
-
GdkPixbuf *loadPixbuf (const std::string &fileneme);
/* Tries to make sense out of the string, applying some stock icon to the button. */
Modified: trunk/gtk/src/YGWizard.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGWizard.cc?rev=49531&r1…
==============================================================================
--- trunk/gtk/src/YGWizard.cc (original)
+++ trunk/gtk/src/YGWizard.cc Thu Jul 31 03:36:55 2008
@@ -271,11 +271,11 @@
YGUI::ui()->sendEvent (new YWidgetEvent ((YWidget *) id, YEvent::Activated));
}
+ // YGWidget
virtual void doAddChild (YWidget *ychild, GtkWidget *container)
{
- if (ychild->widgetRep())
- // don't actually add the button wrappers
- YGWidget::doAddChild (ychild, container);
+ if (ychild->widgetRep()) // don't actually add the button wrappers
+ ygtk_wizard_set_child (getWizard(), YGWidget::get (ychild)->getLayout());
}
YGWIDGET_IMPL_COMMON
Modified: trunk/gtk/src/pkg-selector-help.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg-selector-help.h?rev=…
==============================================================================
--- trunk/gtk/src/pkg-selector-help.h (original)
+++ trunk/gtk/src/pkg-selector-help.h Thu Jul 31 03:36:55 2008
@@ -4,7 +4,7 @@
static const char *pkg_help =
"<h1>Purpose</h1>"
-"<p>This tool lets you manage software, as in 'install, remove, update applications'.</p>"
+"<p>This tool lets you install, remove, and update applications.</p>"
"<p>openSUSE's software management is also called 'package management'. A package is "
"generally an application bundle, but multiple packages that extend the application "
"may be offered in order to avoid clutter (e.g. games tend to de-couple the music "
Added: trunk/gtk/src/ygtkhandlebox.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkhandlebox.c?rev=4953…
==============================================================================
--- trunk/gtk/src/ygtkhandlebox.c (added)
+++ trunk/gtk/src/ygtkhandlebox.c Thu Jul 31 03:36:55 2008
@@ -0,0 +1,66 @@
+/********************************************************************
+ * YaST2-GTK - http://en.opensuse.org/YaST2-GTK *
+ ********************************************************************/
+
+/* YGtkHandleBox widget */
+// check the header file for information about this widget
+
+#include <config.h>
+#include "ygtkhandlebox.h"
+
+G_DEFINE_TYPE (YGtkHandleBox, ygtk_handle_box, GTK_TYPE_HANDLE_BOX)
+
+static void ygtk_handle_box_init (YGtkHandleBox *box)
+{
+}
+
+static void ygtk_handle_box_realize (GtkWidget *widget)
+{
+ GTK_WIDGET_CLASS (ygtk_handle_box_parent_class)->realize (widget);
+
+ GtkHandleBox *box = GTK_HANDLE_BOX (widget);
+ GdkWindow *window = box->float_window;
+ gdk_window_set_decorations (window, GDK_DECOR_RESIZEH);
+ gdk_window_set_type_hint (window, GDK_WINDOW_TYPE_HINT_DIALOG);
+ gdk_window_set_title (window, "");
+}
+
+static gboolean ygtk_handle_box_configure_event (GtkWidget *widget, GdkEventConfigure *event)
+{
+ GtkHandleBox *box = GTK_HANDLE_BOX (widget);
+ if (event->window == box->float_window) {
+ gtk_widget_queue_resize (widget);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static void ygtk_handle_box_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
+{
+ GtkHandleBox *box = GTK_HANDLE_BOX (widget);
+ if (box->child_detached) {
+ gdk_window_move_resize (widget->window, allocation->x, allocation->y,
+ allocation->width, allocation->height);
+ gint width, height;
+ gdk_drawable_get_size (box->float_window, &width, &height);
+ gdk_window_resize (box->bin_window, width, height);
+ GtkAllocation child_alloc = { 0, 0, width, height };
+ gtk_widget_size_allocate (GTK_BIN (widget)->child, &child_alloc);
+ }
+ else
+ GTK_WIDGET_CLASS (ygtk_handle_box_parent_class)->size_allocate (widget, allocation);
+}
+
+GtkWidget* ygtk_handle_box_new (void)
+{ return g_object_new (YGTK_TYPE_HANDLE_BOX, NULL); }
+
+static void ygtk_handle_box_class_init (YGtkHandleBoxClass *klass)
+{
+ ygtk_handle_box_parent_class = g_type_class_peek_parent (klass);
+
+ GtkWidgetClass* widget_class = GTK_WIDGET_CLASS (klass);
+ widget_class->configure_event = ygtk_handle_box_configure_event;
+ widget_class->realize = ygtk_handle_box_realize;
+ widget_class->size_allocate = ygtk_handle_box_size_allocate;
+}
+
Added: trunk/gtk/src/ygtkhandlebox.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkhandlebox.h?rev=4953…
==============================================================================
--- trunk/gtk/src/ygtkhandlebox.h (added)
+++ trunk/gtk/src/ygtkhandlebox.h Thu Jul 31 03:36:55 2008
@@ -0,0 +1,44 @@
+/********************************************************************
+ * YaST2-GTK - http://en.opensuse.org/YaST2-GTK *
+ ********************************************************************/
+
+/* YGtkHandleBox changes the GtkHandleBox behavior so that the detached
+ window can be user resized.
+*/
+
+#ifndef YGTK_HANDLE_BOX_H
+#define YGTK_HANDLE_BOX_H
+
+#include <gtk/gtkhandlebox.h>
+
+G_BEGIN_DECLS
+
+#define YGTK_TYPE_HANDLE_BOX (ygtk_handle_box_get_type ())
+#define YGTK_HANDLE_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ YGTK_TYPE_HANDLE_BOX, YGtkHandleBox))
+#define YGTK_HANDLE_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
+ YGTK_TYPE_HANDLE_BOX, YGtkHandleBoxClass))
+#define YGTK_IS_HANDLE_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+ YGTK_TYPE_HANDLE_BOX))
+#define YGTK_IS_HANDLE_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+ YGTK_TYPE_HANDLE_BOX))
+#define YGTK_HANDLE_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+ YGTK_TYPE_HANDLE_BOX, YGtkHandleboxClass))
+
+typedef struct _YGtkHandleBox
+{
+ GtkHandleBox parent;
+} YGtkHandleBox;
+
+typedef struct _YGtkHandleBoxClass
+{
+ GtkHandleBoxClass parent_class;
+} YGtkHandleBoxClass;
+
+GtkWidget* ygtk_handle_box_new (void);
+GType ygtk_handle_box_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* YGTK_HANDLE_BOX_H */
+
Added: trunk/gtk/src/ygtklinklabel.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtklinklabel.c?rev=4953…
==============================================================================
--- trunk/gtk/src/ygtklinklabel.c (added)
+++ trunk/gtk/src/ygtklinklabel.c Thu Jul 31 03:36:55 2008
@@ -0,0 +1,216 @@
+/********************************************************************
+ * YaST2-GTK - http://en.opensuse.org/YaST2-GTK *
+ ********************************************************************/
+
+/* YGtkLinkLabel container */
+// check the header file for information about this container
+
+#include <config.h>
+#include <math.h>
+#include <gtk/gtk.h>
+#include "ygtklinklabel.h"
+
+static guint link_clicked_signal;
+
+G_DEFINE_TYPE (YGtkLinkLabel, ygtk_link_label, GTK_TYPE_WIDGET)
+
+static void ygtk_link_label_init (YGtkLinkLabel *label)
+{
+ GTK_WIDGET_SET_FLAGS (label, GTK_NO_WINDOW);
+}
+
+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;
+ attributes.window_type = GDK_WINDOW_CHILD;
+ attributes.wclass = GDK_INPUT_OUTPUT;
+ attributes.event_mask = gtk_widget_get_events (widget) |
+ GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK;
+ gint attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_CURSOR;
+ attributes.cursor = gdk_cursor_new_for_display (
+ gtk_widget_get_display (widget), GDK_HAND1);
+
+ YGtkLinkLabel *label = YGTK_LINK_LABEL (widget);
+ label->link_window = gdk_window_new (widget->window, &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);
+}
+
+static void ygtk_link_label_unrealize (GtkWidget *widget)
+{
+ YGtkLinkLabel *label = YGTK_LINK_LABEL (widget);
+ if (label->link_window) {
+ gdk_window_set_user_data (label->link_window, NULL);
+ gdk_window_destroy (label->link_window);
+ label->link_window = NULL;
+ }
+ GTK_WIDGET_CLASS (ygtk_link_label_parent_class)->unrealize (widget);
+}
+
+static void ygtk_link_label_clear_layout (YGtkLinkLabel *label)
+{
+ if (label->layout) {
+ g_object_unref (label->layout);
+ label->layout = NULL;
+ }
+ if (label->link_layout) {
+ g_object_unref (label->link_layout);
+ label->link_layout = NULL;
+ }
+}
+
+static void ygtk_link_label_ensure_layout (YGtkLinkLabel *label)
+{
+ GtkWidget *widget = GTK_WIDGET (label);
+ if (!label->layout) {
+ label->layout = gtk_widget_create_pango_layout (widget, label->text);
+ pango_layout_set_single_paragraph_mode (label->layout, TRUE);
+ pango_layout_set_ellipsize (label->layout, PANGO_ELLIPSIZE_END);
+ pango_layout_set_width (label->layout, widget->allocation.width * PANGO_SCALE);
+ }
+ if (!label->link_layout) {
+ label->link_layout = gtk_widget_create_pango_layout (widget, label->link);
+ PangoAttrList *attrbs = pango_attr_list_new();
+ pango_attr_list_insert (attrbs, pango_attr_underline_new (PANGO_UNDERLINE_SINGLE));
+ pango_attr_list_insert (attrbs, pango_attr_foreground_new (0, 0, 0xffff));
+ pango_layout_set_attributes (label->link_layout, attrbs);
+ pango_attr_list_unref (attrbs);
+ }
+}
+
+static void ygtk_link_label_finalize (GObject *object)
+{
+ YGtkLinkLabel *label = YGTK_LINK_LABEL (object);
+ g_free (label->text);
+ g_free (label->link);
+ ygtk_link_label_clear_layout (label);
+ G_OBJECT_CLASS (ygtk_link_label_parent_class)->finalize (object);
+}
+
+static void ygtk_link_label_size_request (GtkWidget *widget,
+ GtkRequisition *requisition)
+{
+ YGtkLinkLabel *label = YGTK_LINK_LABEL (widget);
+ ygtk_link_label_ensure_layout (label);
+ requisition->width = 0;
+
+ PangoContext *context;
+ PangoFontMetrics *metrics;
+ gint ascent, descent;
+ context = pango_layout_get_context (label->layout);
+ metrics = pango_context_get_metrics (context, widget->style->font_desc,
+ pango_context_get_language (context));
+ ascent = pango_font_metrics_get_ascent (metrics);
+ descent = pango_font_metrics_get_descent (metrics);
+ pango_font_metrics_unref (metrics);
+ requisition->height = PANGO_PIXELS (ascent + descent);
+}
+
+static void ygtk_link_label_size_allocate (GtkWidget *widget,
+ GtkAllocation *allocation)
+{
+ GTK_WIDGET_CLASS (ygtk_link_label_parent_class)->size_allocate (widget, allocation);
+ YGtkLinkLabel *label = YGTK_LINK_LABEL (widget);
+
+ gint width = allocation->width * PANGO_SCALE;
+ PangoRectangle logical;
+ pango_layout_set_width (label->layout, -1);
+ pango_layout_get_extents (label->layout, NULL, &logical);
+ if (label->link_window) {
+ if (*label->text && (logical.width > width || label->link_always_visible)) {
+ PangoRectangle link_logical;
+ pango_layout_get_extents (label->link_layout, NULL, &link_logical);
+ gint link_width = link_logical.width / PANGO_SCALE;
+ gint x;
+ width = width - link_logical.width + 4*PANGO_SCALE;
+ if (logical.width < width && label->link_always_visible)
+ x = allocation->x + logical.width/PANGO_SCALE + 4;
+ else
+ x = allocation->x + (allocation->width - link_width);
+ gdk_window_move_resize (label->link_window, x,
+ allocation->y, link_width, allocation->height);
+ pango_layout_set_width (label->layout, width);
+ gdk_window_show (label->link_window);
+ }
+ else
+ gdk_window_hide (label->link_window);
+ }
+}
+
+static gboolean ygtk_link_label_expose_event (GtkWidget *widget, GdkEventExpose *event)
+{
+ 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) {
+ 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);
+ return FALSE;
+}
+
+static gboolean ygtk_link_label_button_press_event (GtkWidget *widget, GdkEventButton *event)
+{
+ g_signal_emit (widget, link_clicked_signal, 0, NULL);
+ return FALSE;
+}
+
+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);
+ if (link) {
+ g_free (label->link);
+ label->link = g_strdup (link);
+ }
+ label->link_always_visible = link_always_visible;
+ ygtk_link_label_clear_layout (label);
+ gtk_widget_queue_resize (GTK_WIDGET (label));
+}
+
+GtkWidget *ygtk_link_label_new (const gchar *text, const gchar *link)
+{
+ YGtkLinkLabel *label = g_object_new (YGTK_TYPE_LINK_LABEL, NULL);
+ ygtk_link_label_set_text (label, text, link, TRUE);
+ return (GtkWidget *) label;
+}
+
+static void ygtk_link_label_class_init (YGtkLinkLabelClass *klass)
+{
+ ygtk_link_label_parent_class = g_type_class_peek_parent (klass);
+
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ widget_class->realize = ygtk_link_label_realize;
+ widget_class->unrealize = ygtk_link_label_unrealize;
+ widget_class->size_request = ygtk_link_label_size_request;
+ widget_class->size_allocate = ygtk_link_label_size_allocate;
+ widget_class->expose_event = ygtk_link_label_expose_event;
+ widget_class->button_press_event = ygtk_link_label_button_press_event;
+
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = ygtk_link_label_finalize;
+
+ link_clicked_signal = g_signal_new ("link-clicked",
+ G_TYPE_FROM_CLASS (G_OBJECT_CLASS (klass)), G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (YGtkLinkLabelClass, link_clicked), NULL, NULL,
+ g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+}
+
Added: trunk/gtk/src/ygtklinklabel.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtklinklabel.h?rev=4953…
==============================================================================
--- trunk/gtk/src/ygtklinklabel.h (added)
+++ trunk/gtk/src/ygtklinklabel.h Thu Jul 31 03:36:55 2008
@@ -0,0 +1,54 @@
+/********************************************************************
+ * YaST2-GTK - http://en.opensuse.org/YaST2-GTK *
+ ********************************************************************/
+
+/* A label with embed links. Because we only need a link at the end, that's
+ only what we support. */
+
+#ifndef YGTK_LINK_LABEL_H
+#define YGTK_LINK_LABEL_H
+
+#include <gtk/gtkwidget.h>
+G_BEGIN_DECLS
+
+#define YGTK_TYPE_LINK_LABEL (ygtk_link_label_get_type ())
+#define YGTK_LINK_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ YGTK_TYPE_LINK_LABEL, YGtkLinkLabel))
+#define YGTK_LINK_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
+ YGTK_TYPE_LINK_LABEL, YGtkLinkLabelClass))
+#define YGTK_IS_LINK_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+ YGTK_TYPE_LINK_LABEL))
+#define YGTK_IS_LINK_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+ YGTK_TYPE_LINK_LABEL))
+#define YGTK_LINK_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+ YGTK_TYPE_LINK_LABEL, YGtkLinkLabelClass))
+
+typedef struct _YGtkLinkLabel YGtkLinkLabel;
+typedef struct _YGtkLinkLabelClass YGtkLinkLabelClass;
+
+struct _YGtkLinkLabel
+{
+ GtkWidget parent;
+ // private (read-only):
+ gchar *text, *link;
+ gboolean link_always_visible;
+ PangoLayout *layout, *link_layout;
+ GdkWindow *link_window;
+};
+
+struct _YGtkLinkLabelClass
+{
+ GtkWidgetClass parent_class;
+ // signals:
+ void (*link_clicked) (YGtkLinkLabel *label);
+};
+
+GtkWidget *ygtk_link_label_new (const gchar *text, const gchar *link);
+GType ygtk_link_label_get_type (void) G_GNUC_CONST;
+
+void ygtk_link_label_set_text (YGtkLinkLabel *label, const gchar *text, const gchar *link,
+ gboolean always_show_link);
+
+G_END_DECLS
+#endif /*YGTK_LINK_LABEL_H*/
+
Modified: trunk/gtk/src/ygtksteps.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtksteps.c?rev=49531&r1…
==============================================================================
--- trunk/gtk/src/ygtksteps.c (original)
+++ trunk/gtk/src/ygtksteps.c Thu Jul 31 03:36:55 2008
@@ -14,8 +14,8 @@
#include <string.h>
#define BORDER 6
-#define STEPS_HEADER_SPACING 8
-#define STEPS_SPACING 2
+#define STEPS_HEADER_SPACING 12
+#define STEPS_SPACING 4
#define STEPS_IDENTATION 30
#define CURRENT_MARK_ANIMATION_TIME 250
#define CURRENT_MARK_ANIMATION_OFFSET 3
@@ -44,10 +44,11 @@
steps->current_mark_timeout_id = 0;
}
- g_object_unref (steps->check_mark_layout);
+ if (steps->check_mark_layout)
+ g_object_unref (steps->check_mark_layout);
steps->check_mark_layout = NULL;
-
- g_object_unref (steps->current_mark_layout);
+ if (steps->current_mark_layout)
+ g_object_unref (steps->current_mark_layout);
steps->current_mark_layout = NULL;
ygtk_steps_clear (steps);
@@ -165,9 +166,26 @@
static gboolean ygtk_steps_expose_event (GtkWidget *widget, GdkEventExpose *event)
{
- int x = widget->allocation.x + BORDER, y = widget->allocation.y + BORDER;
GtkStyle *style = gtk_widget_get_style (widget);
+ // background
+ cairo_t *cr = gdk_cairo_create (widget->window);
+
+ int x, y, w, h;
+ x = widget->allocation.x; y = widget->allocation.y;
+ w = widget->allocation.width; h = widget->allocation.height;
+
+ cairo_pattern_t *pattern = cairo_pattern_create_linear (x, y, x, y+h);
+ cairo_pattern_add_color_stop_rgba (pattern, 0, 1, 1, 1, 1);
+ cairo_pattern_add_color_stop_rgba (pattern, 1, 1, 1, 1, 0);
+ cairo_set_source (cr, pattern);
+ cairo_rectangle (cr, x, y, w, h);
+ cairo_fill (cr);
+ cairo_pattern_destroy (pattern);
+ cairo_destroy (cr);
+
+ // content
+ x = widget->allocation.x + BORDER; y = widget->allocation.y + BORDER;
YGtkSteps *steps = YGTK_STEPS (widget);
int i;
for (i = 0; i < ygtk_steps_total (steps); i++) {
Modified: trunk/gtk/src/ygtkwizard.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkwizard.c?rev=49531&r…
==============================================================================
--- trunk/gtk/src/ygtkwizard.c (original)
+++ trunk/gtk/src/ygtkwizard.c Thu Jul 31 03:36:55 2008
@@ -18,30 +18,15 @@
#include "ygtkhtmlwrap.h"
#include "ygtksteps.h"
#include "ygtkfindentry.h"
+#include "ygtklinklabel.h"
#define YGI18N_C
#include "YGi18n.h"
-#define BUTTONS_SPACING 12
-#define BORDER 4
-#define CHILD_BORDER 6
// YGUtils bridge
extern void ygutils_setWidgetFont (GtkWidget *widget, PangoWeight weight,
- double scale);
+ double scale);
extern void ygutils_setStockIcon (GtkWidget *button, const char *ycp_str);
-static void set_label_header_cb (GtkWidget *label, GtkStyle *prev_style, gpointer psize)
-{
- if (prev_style) return;
- double size = psize == 0 ? PANGO_SCALE_LARGE : PANGO_SCALE_XX_LARGE;
- gtk_widget_modify_fg (label, GTK_STATE_NORMAL, &label->style->fg [GTK_STATE_SELECTED]);
- ygutils_setWidgetFont (label, PANGO_WEIGHT_ULTRABOLD, size);
-}
-static void set_label_header (GtkWidget *label, int size)
-{
- g_signal_connect (G_OBJECT (label), "style-set",
- G_CALLBACK (set_label_header_cb), GINT_TO_POINTER (size));
-}
-
//** YGtkHelpDialog
G_DEFINE_TYPE (YGtkHelpDialog, ygtk_help_dialog, GTK_TYPE_WINDOW)
@@ -78,26 +63,13 @@
{
gtk_container_set_border_width (GTK_CONTAINER (dialog), 6);
gtk_window_set_type_hint (GTK_WINDOW (dialog), GDK_WINDOW_TYPE_HINT_DIALOG);
-
-
gtk_window_set_title (GTK_WINDOW (dialog), _("Help"));
+ GdkPixbuf *icon = gtk_widget_render_icon (
+ GTK_WIDGET (dialog), GTK_STOCK_HELP, GTK_ICON_SIZE_MENU, NULL);
+ gtk_window_set_icon (GTK_WINDOW (dialog), icon);
+ g_object_unref (G_OBJECT (icon));
gtk_window_set_default_size (GTK_WINDOW (dialog), 400, 350);
- // title
- GtkStockItem help_item;
- gtk_stock_lookup (GTK_STOCK_HELP, &help_item);
-
- dialog->title_box = gtk_hbox_new (FALSE, 6);
- gtk_container_set_border_width (GTK_CONTAINER (dialog->title_box), 6);
- dialog->title_image = gtk_image_new_from_stock (GTK_STOCK_HELP,
- GTK_ICON_SIZE_LARGE_TOOLBAR);
- dialog->title_label = gtk_label_new (_("Help"));
- set_label_header (dialog->title_label, 0);
- gtk_box_pack_start (GTK_BOX (dialog->title_box), dialog->title_image,
- FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (dialog->title_box), dialog->title_label,
- FALSE, FALSE, 0);
-
// help text
dialog->help_box = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (dialog->help_box),
@@ -125,7 +97,6 @@
// glue it
dialog->vbox = gtk_vbox_new (FALSE, 12);
- gtk_box_pack_start (GTK_BOX (dialog->vbox), dialog->title_box, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (dialog->vbox), dialog->help_box, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (dialog->vbox), bottom_box, FALSE, FALSE, 0);
gtk_container_add (GTK_CONTAINER (dialog), dialog->vbox);
@@ -147,30 +118,6 @@
gtk_widget_grab_focus (dialog->close_button);
}
-static gboolean ygtk_help_dialog_expose_event (GtkWidget *widget, GdkEventExpose *event)
-{
- YGtkHelpDialog *dialog = YGTK_HELP_DIALOG (widget);
-
- // draw rect on title
- int x, y, w, h;
- x = dialog->title_box->allocation.x;
- y = dialog->title_box->allocation.y;
- w = dialog->title_box->allocation.width;
- h = dialog->title_box->allocation.height;
- if (x + w >= event->area.x && x <= event->area.x + event->area.width &&
- y + h >= event->area.y && x <= event->area.y + event->area.height) {
- cairo_t *cr = gdk_cairo_create (widget->window);
- gdk_cairo_set_source_color (cr, &widget->style->bg [GTK_STATE_SELECTED]);
- cairo_rectangle (cr, x, y, w, h);
- cairo_fill (cr);
-
- cairo_destroy (cr);
- }
-
- gtk_container_propagate_expose (GTK_CONTAINER (dialog), dialog->vbox, event);
- return FALSE;
-}
-
static void ygtk_help_dialog_close (YGtkHelpDialog *dialog)
{ gtk_widget_hide (GTK_WIDGET (dialog)); }
@@ -194,7 +141,6 @@
klass->close = ygtk_help_dialog_close;
GtkWidgetClass* widget_class = GTK_WIDGET_CLASS (klass);
- widget_class->expose_event = ygtk_help_dialog_expose_event;
widget_class->realize = ygtk_help_dialog_realize;
// key bindings (F3 for next word, Esc to close the window)
@@ -212,31 +158,162 @@
gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0, "close", 0);
}
-//** YGtkWizard
+//** Header
+
+typedef struct _YGtkWizardHeader
+{
+ GtkEventBox box;
+ // members:
+ GtkWidget *title, *description, *icon, *description_more;
+} YGtkWizardHeader;
-static gint get_header_padding (GtkWidget *widget)
+typedef struct _YGtkWizardHeaderClass
{
-#if 0
-// TODO: read GtkAssistance style_rc attributes
- gint padding;
- gtk_widget_style_get (widget, "header-padding", &padding, NULL);
- return padding;
-#else
- return 6;
-#endif
-}
-
-static gint get_content_padding (GtkWidget *widget)
-{
-#if 0
- gint padding;
- gtk_widget_style_get (widget, "content-padding", &padding, NULL);
- return padding;
-#else
- return 1;
-#endif
+ GtkEventBoxClass parent_class;
+ // signals:
+ void (*more_clicked) (YGtkWizardHeader *header);
+} YGtkWizardHeaderClass;
+
+static guint more_clicked_signal;
+
+#define YGTK_TYPE_WIZARD_HEADER (ygtk_wizard_header_get_type ())
+#define YGTK_WIZARD_HEADER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ YGTK_TYPE_WIZARD_HEADER, YGtkWizardHeader))
+#define YGTK_WIZARD_HEADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
+ YGTK_TYPE_WIZARD_HEADER, YGtkWizardHeaderClass))
+#define YGTK_IS_WIZARD_HEADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+ YGTK_TYPE_WIZARD_HEADER))
+#define YGTK_IS_WIZARD_HEADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+ YGTK_TYPE_WIZARD_HEADER))
+#define YGTK_WIZARD_HEADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+ YGTK_TYPE_WIZARD_HEADER, YGtkWizardHeaderClass))
+
+static GtkWidget *ygtk_wizard_header_new (void);
+static GType ygtk_wizard_header_get_type (void) G_GNUC_CONST;
+
+G_DEFINE_TYPE (YGtkWizardHeader, ygtk_wizard_header, GTK_TYPE_EVENT_BOX)
+
+static void description_link_clicked_cb (YGtkLinkLabel *label, YGtkWizardHeader *header)
+{
+ g_signal_emit (header, more_clicked_signal, 0, NULL);
+}
+
+static void ygtk_wizard_header_init (YGtkWizardHeader *header)
+{
+ GdkColor white = { 0, 0xffff, 0xffff, 0xffff };
+ gtk_widget_modify_bg (GTK_WIDGET (header), GTK_STATE_NORMAL, &white);
+
+ header->title = gtk_label_new (NULL);
+ gtk_label_set_ellipsize (GTK_LABEL (header->title), PANGO_ELLIPSIZE_END);
+ gtk_misc_set_alignment (GTK_MISC (header->title), 0, 0.5);
+ ygutils_setWidgetFont (header->title, PANGO_WEIGHT_BOLD, PANGO_SCALE_XX_LARGE);
+
+ header->description = ygtk_link_label_new ("", _("more"));
+ g_signal_connect (G_OBJECT (header->description), "link-clicked",
+ G_CALLBACK (description_link_clicked_cb), header);
+
+ header->icon = gtk_image_new();
+
+ GtkWidget *text_box = gtk_vbox_new (FALSE, 1);
+ gtk_box_pack_start (GTK_BOX (text_box), header->title, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (text_box), header->description, FALSE, TRUE, 0);
+
+ GtkWidget *title_box = gtk_hbox_new (FALSE, 10);
+ gtk_box_pack_start (GTK_BOX (title_box), header->icon, FALSE, TRUE, 4);
+ gtk_box_pack_start (GTK_BOX (title_box), text_box, TRUE, TRUE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (title_box), 6);
+
+ GtkWidget *box = gtk_vbox_new (FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (box), title_box, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (box), gtk_hseparator_new(), FALSE, TRUE, 0);
+ gtk_widget_show_all (box);
+ gtk_container_add (GTK_CONTAINER (header), box);
+}
+
+GtkWidget *ygtk_wizard_header_new()
+{ return g_object_new (YGTK_TYPE_WIZARD_HEADER, NULL); }
+
+static void ygtk_wizard_header_class_init (YGtkWizardHeaderClass *klass)
+{
+ more_clicked_signal = g_signal_new ("more-clicked",
+ G_TYPE_FROM_CLASS (G_OBJECT_CLASS (klass)), G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (YGtkWizardHeaderClass, more_clicked), NULL, NULL,
+ g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+}
+
+static void ygtk_wizard_header_set_title (YGtkWizardHeader *header, const gchar *text)
+{ gtk_label_set_text (GTK_LABEL (header->title), text); }
+
+static void ygtk_wizard_header_set_description (YGtkWizardHeader *header, const gchar *text)
+{
+ GString *str = g_string_new ("");
+ int i;
+ gboolean copy_word = FALSE;
+ for (i = 0; text[i]; i++) {
+ if (text[i] == '<') {
+ int a = i;
+ 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++) {
+ if (text[i] == '<')
+ a = i;
+ if (text[i] == '>') {
+ if (!strncasecmp (text+a, "</h", 3) || !strncasecmp (text+a, "</big>", 6) ||
+ !strncasecmp (text+a, "</b>", 4))
+ break;
+ }
+ }
+ }
+ }
+ else if (g_ascii_isspace (text[i])) {
+ if (copy_word)
+ g_string_append_c (str, ' ');
+ copy_word = FALSE;
+ }
+ else {
+ copy_word = TRUE;
+ if (text[i] == '&') {
+ if (!strncasecmp (text+i, "&product;", 9)) {
+ g_string_append (str, "Linux");
+ i += 8;
+ }
+ }
+ else {
+ g_string_append_c (str, text[i]);
+ if (text[i] == '.') {
+ if (g_ascii_isspace (text[i+1]) || text[i+1] == '<') {
+ i++;
+ break;
+ }
+ }
+ }
+ }
+ }
+ gboolean cut = FALSE;
+ for (; text[i]; i++) {
+ if (!g_ascii_isspace (text[i])) {
+ cut = TRUE;
+ break;
+ }
+ }
+ gchar *desc = g_string_free (str, FALSE);
+ ygtk_link_label_set_text (YGTK_LINK_LABEL (header->description), desc, NULL, cut);
+ g_free (desc);
}
+static void ygtk_wizard_header_set_icon (YGtkWizardHeader *header, GdkPixbuf *pixbuf)
+{ gtk_image_set_from_pixbuf (GTK_IMAGE (header->icon), pixbuf); }
+
+static const gchar *ygtk_wizard_header_get_title (YGtkWizardHeader *header)
+{ return gtk_label_get_text (GTK_LABEL (header->title)); }
+static GdkPixbuf *ygtk_wizard_header_get_icon (YGtkWizardHeader *header)
+{ return gtk_image_get_pixbuf (GTK_IMAGE (header->icon)); }
+
+//** YGtkWizard
+
// callbacks
static void destroy_tree_path (gpointer data)
{
@@ -294,6 +371,40 @@
return button;
}
+static GtkWidget *create_help_button()
+{
+ GtkWidget *button, *box, *image;
+ box = gtk_hbox_new (FALSE, 6);
+ image = gtk_image_new_from_stock (GTK_STOCK_HELP, GTK_ICON_SIZE_BUTTON);
+ gtk_box_pack_start (GTK_BOX (box), image, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (box), gtk_label_new (_("Help")), TRUE, TRUE, 0);
+ gtk_widget_show_all (box);
+ button = gtk_toggle_button_new();
+ gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
+ gtk_container_add (GTK_CONTAINER (button), box);
+ return button;
+}
+
+static void ygtk_wizard_popup_help (YGtkWizard *wizard);
+static void help_button_toggled_cb (GtkToggleButton *button, YGtkWizard *wizard)
+{
+ if (gtk_toggle_button_get_active (button))
+ ygtk_wizard_popup_help (wizard);
+ else if (wizard->m_help_dialog)
+ gtk_widget_hide (wizard->m_help_dialog);
+}
+static void help_button_silent_set_active (YGtkWizard *wizard, gboolean active)
+{
+ GtkToggleButton *button = GTK_TOGGLE_BUTTON (wizard->m_help_button);
+ g_signal_handlers_block_by_func (button,
+ (gpointer) help_button_toggled_cb, wizard);
+ gtk_toggle_button_set_active (button, active);
+ g_signal_handlers_unblock_by_func (button,
+ (gpointer) help_button_toggled_cb, wizard);
+}
+static void help_dialog_unmap_cb (GtkWidget *dialog, YGtkWizard *wizard)
+{ help_button_silent_set_active (wizard, FALSE); }
+
static void ygtk_wizard_popup_help (YGtkWizard *wizard)
{
if (!wizard->m_help_dialog) {
@@ -302,14 +413,17 @@
wizard->m_help_dialog = ygtk_help_dialog_new (window);
ygtk_help_dialog_set_text (YGTK_HELP_DIALOG (wizard->m_help_dialog),
wizard->m_help);
+ g_signal_connect (G_OBJECT (wizard->m_help_dialog), "unmap",
+ G_CALLBACK (help_dialog_unmap_cb), wizard);
}
+ help_button_silent_set_active (wizard, TRUE);
gtk_window_present (GTK_WINDOW (wizard->m_help_dialog));
}
-static void help_button_clicked_cb (GtkWidget *button, YGtkWizard *wizard)
+static void more_clicked_cb (YGtkWizardHeader *header, YGtkWizard *wizard)
{ ygtk_wizard_popup_help (wizard); }
-G_DEFINE_TYPE (YGtkWizard, ygtk_wizard, GTK_TYPE_BIN)
+G_DEFINE_TYPE (YGtkWizard, ygtk_wizard, GTK_TYPE_VBOX)
static void ygtk_wizard_init (YGtkWizard *wizard)
{
@@ -320,24 +434,10 @@
wizard->steps_ids = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, NULL);
- gtk_container_set_border_width (GTK_CONTAINER (wizard), BORDER);
- wizard->child_border_width = CHILD_BORDER;
-
//** Title
- wizard->m_title = gtk_hbox_new (FALSE, 0);
-
- wizard->m_title_image = gtk_image_new();
- wizard->m_title_label = gtk_label_new("");
- gtk_label_set_ellipsize (GTK_LABEL (wizard->m_title_label), PANGO_ELLIPSIZE_END);
- gtk_misc_set_alignment (GTK_MISC (wizard->m_title_label), 0, 0.5);
- set_label_header (wizard->m_title_label, 1);
-
- gtk_box_pack_start (GTK_BOX (wizard->m_title), wizard->m_title_label,
- TRUE, TRUE, 0);
- gtk_box_pack_end (GTK_BOX (wizard->m_title), wizard->m_title_image,
- FALSE, FALSE, 0);
-
- gtk_widget_set_parent (wizard->m_title, GTK_WIDGET (wizard));
+ wizard->m_title = ygtk_wizard_header_new();
+ g_signal_connect (G_OBJECT (wizard->m_title), "more-clicked",
+ G_CALLBACK (more_clicked_cb), wizard);
gtk_widget_show_all (wizard->m_title);
//** Adding the bottom buttons
@@ -345,18 +445,16 @@
wizard->m_back_button = button_new (wizard);
wizard->m_abort_button = button_new (wizard);
wizard->m_release_notes_button = button_new (wizard);
-
- wizard->m_help_button = gtk_button_new_from_stock (GTK_STOCK_HELP);
- GTK_WIDGET_SET_FLAGS (wizard->m_help_button, GTK_CAN_DEFAULT);
- g_signal_connect (G_OBJECT (wizard->m_help_button), "clicked",
- G_CALLBACK (help_button_clicked_cb), wizard);
+ wizard->m_help_button = create_help_button();
+ g_signal_connect (G_OBJECT (wizard->m_help_button), "toggled",
+ G_CALLBACK (help_button_toggled_cb), wizard);
// we need to protect this button against insensitive in some cases
// this is a flag to enable that
ygtk_wizard_protect_next_button (wizard, FALSE);
wizard->m_buttons = gtk_hbox_new (FALSE, 12);
-
+ gtk_widget_show (wizard->m_buttons);
gtk_box_pack_start (GTK_BOX (wizard->m_buttons), wizard->m_help_button, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (wizard->m_buttons), wizard->m_release_notes_button,
FALSE, TRUE, 0);
@@ -365,9 +463,6 @@
gtk_box_pack_end (GTK_BOX (wizard->m_buttons), wizard->m_back_button, FALSE, TRUE, 0);
gtk_box_pack_end (GTK_BOX (wizard->m_buttons), wizard->m_abort_button, FALSE, TRUE, 0);
- gtk_widget_set_parent (wizard->m_buttons, GTK_WIDGET (wizard));
- gtk_widget_show (wizard->m_buttons);
-
// make buttons all having the same size
GtkSizeGroup *buttons_group = gtk_size_group_new (GTK_SIZE_GROUP_BOTH);
gtk_size_group_add_widget (buttons_group, wizard->m_help_button);
@@ -377,8 +472,25 @@
gtk_size_group_add_widget (buttons_group, wizard->m_abort_button);
g_object_unref (G_OBJECT (buttons_group));
+
//** The menu and the navigation widgets will be created when requested.
- //** Help dialog will be build on realize so we can give it a parent window.
+ // space for them
+ wizard->m_menu_box = gtk_event_box_new();
+
+ wizard->m_pane = gtk_hpaned_new();
+ gtk_widget_show (wizard->m_pane);
+ wizard->m_contents_box = gtk_hbox_new (FALSE, 6);
+ GtkWidget *contents_align = gtk_alignment_new (0, 0, 1, 1);
+ gtk_alignment_set_padding (GTK_ALIGNMENT (contents_align), 6, 12, 0, 0);
+ gtk_container_add (GTK_CONTAINER (contents_align), wizard->m_pane);
+ gtk_box_pack_start (GTK_BOX (wizard->m_contents_box), contents_align, TRUE, TRUE, 0);
+ gtk_widget_show_all (wizard->m_contents_box);
+
+// gtk_box_set_spacing (GTK_BOX (wizard), 6);
+ gtk_box_pack_start (GTK_BOX (wizard), wizard->m_menu_box, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (wizard), wizard->m_title, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (wizard), wizard->m_contents_box, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (wizard), wizard->m_buttons, FALSE, TRUE, 6);
}
static void ygtk_wizard_realize (GtkWidget *widget)
@@ -401,7 +513,6 @@
GTK_OBJECT_CLASS (ygtk_wizard_parent_class)->destroy (object);
YGtkWizard *wizard = YGTK_WIZARD (object);
-
destroy_hash (&wizard->menu_ids);
destroy_hash (&wizard->tree_ids);
destroy_hash (&wizard->steps_ids);
@@ -410,22 +521,6 @@
g_free (wizard->m_help);
wizard->m_help = NULL;
}
-
-/* We must unparent these widgets from the wizard as they would try
- to use gtk_container_remove() on it. We ref them since we still
- want to call destroy on them so they children die. */
-#define DESTROY_WIDGET(widget) \
- if (widget) { \
- gtk_widget_unparent (widget); \
- widget = NULL; \
- }
- DESTROY_WIDGET (wizard->m_title)
- DESTROY_WIDGET (wizard->m_buttons)
- DESTROY_WIDGET (wizard->m_menu)
- DESTROY_WIDGET (wizard->m_steps)
- DESTROY_WIDGET (wizard->m_title)
-#undef DESTROY_WIDGET
-
if (wizard->m_help_dialog) {
gtk_widget_destroy (wizard->m_help_dialog);
wizard->m_help_dialog = NULL;
@@ -433,9 +528,7 @@
}
GtkWidget *ygtk_wizard_new (void)
-{
- return g_object_new (YGTK_TYPE_WIZARD, NULL);
-}
+{ return g_object_new (YGTK_TYPE_WIZARD, NULL); }
static void selected_menu_item_cb (GtkMenuItem *item, const char *id)
{
@@ -450,22 +543,33 @@
g_signal_emit (wizard, action_triggered_signal, 0, id, G_TYPE_STRING);
}
+void ygtk_wizard_set_child (YGtkWizard *wizard, GtkWidget *widget)
+{
+ wizard->m_child = widget;
+ gtk_paned_pack2 (GTK_PANED (wizard->m_pane), widget, TRUE, TRUE);
+}
+
+void ygtk_wizard_set_information_widget (YGtkWizard *wizard, GtkWidget *widget)
+{
+ gtk_box_pack_start (GTK_BOX (wizard->m_contents_box), widget, FALSE, TRUE, 0);
+}
+
+void ygtk_wizard_set_control_widget (YGtkWizard *wizard, GtkWidget *widget)
+{
+ gtk_paned_pack1 (GTK_PANED (wizard->m_pane), widget, FALSE, TRUE);
+}
+
void ygtk_wizard_enable_steps (YGtkWizard *wizard)
{
g_return_if_fail (wizard->m_steps == NULL);
-
wizard->m_steps = ygtk_steps_new();
- gtk_widget_modify_text (wizard->m_steps, GTK_STATE_NORMAL,
- &wizard->m_steps->style->fg [GTK_STATE_SELECTED]);
-
- gtk_widget_set_parent (wizard->m_steps, GTK_WIDGET (wizard));
gtk_widget_show (wizard->m_steps);
- gtk_widget_queue_resize (GTK_WIDGET (wizard));
+ ygtk_wizard_set_information_widget (wizard, wizard->m_steps);
}
void ygtk_wizard_enable_tree (YGtkWizard *wizard)
{
- g_return_if_fail (wizard->m_tree == NULL);
+ g_return_if_fail (wizard->m_tree_view == NULL);
wizard->m_tree_view = gtk_tree_view_new_with_model
(GTK_TREE_MODEL (gtk_tree_store_new (1, G_TYPE_STRING)));
@@ -479,52 +583,17 @@
// start by assuming it will be list, and set expanders when a tree is built
gtk_tree_view_set_show_expanders (view, FALSE);
- wizard->m_tree = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (wizard->m_tree),
+ GtkWidget *scroll = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (wizard->m_tree),
+ gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll),
GTK_SHADOW_IN);
- gtk_container_add (GTK_CONTAINER (wizard->m_tree), wizard->m_tree_view);
- gtk_widget_set_size_request (wizard->m_tree, 180, -1);
+ gtk_container_add (GTK_CONTAINER (scroll), wizard->m_tree_view);
+ gtk_widget_show_all (scroll);
- GtkWidget *child = wizard->m_child, *pane;
- pane = gtk_hpaned_new();
- gtk_paned_pack1 (GTK_PANED (pane), wizard->m_tree, FALSE, TRUE);
- gtk_widget_show_all (pane);
- ygtk_wizard_set_child (wizard, pane);
- wizard->m_pane = pane;
- if (child)
- gtk_container_add (GTK_CONTAINER (wizard), child);
- gtk_paned_set_position (GTK_PANED (pane), 180);
-}
-
-static void ygtk_wizard_add_child (GtkContainer *container, GtkWidget *child)
-{
- YGtkWizard *wizard = YGTK_WIZARD (container);
- wizard->m_child = child;
- if (wizard->m_pane)
- gtk_paned_pack2 (GTK_PANED (wizard->m_pane), child, TRUE, TRUE);
- else
- GTK_CONTAINER_CLASS (ygtk_wizard_parent_class)->add (container, child);
-}
-
-static void ygtk_wizard_remove_child (GtkContainer *container, GtkWidget *child)
-{
- YGtkWizard *wizard = YGTK_WIZARD (container);
- wizard->m_child = NULL;
- if (wizard->m_pane && child != wizard->m_pane)
- gtk_container_remove (GTK_CONTAINER (wizard->m_pane), child);
- else
- GTK_CONTAINER_CLASS (ygtk_wizard_parent_class)->remove (container, child);
-}
-
-void ygtk_wizard_set_child (YGtkWizard *wizard, GtkWidget *new_child)
-{
- if (wizard->m_child)
- gtk_container_remove (GTK_CONTAINER (wizard), wizard->m_child);
- if (new_child)
- gtk_container_add (GTK_CONTAINER (wizard), new_child);
+ ygtk_wizard_set_control_widget (wizard, scroll);
+ gtk_paned_set_position (GTK_PANED (wizard->m_pane), 180);
}
#define ENABLE_WIDGET(enable, widget) \
@@ -541,6 +610,7 @@
wizard->m_help = g_strdup (text);
if (wizard->m_help_dialog)
ygtk_help_dialog_set_text (YGTK_HELP_DIALOG (wizard->m_help_dialog), text);
+ ygtk_wizard_header_set_description (YGTK_WIZARD_HEADER (wizard->m_title), text);
ENABLE_WIDGET_STR (text, wizard->m_help_button);
}
@@ -611,24 +681,25 @@
{
GtkWidget *window = gtk_widget_get_toplevel (GTK_WIDGET (wizard));
if (GTK_WIDGET_TOPLEVEL (window)) {
- const gchar *_title = gtk_label_get_text (GTK_LABEL (wizard->m_title_label));
+ const gchar *_title = ygtk_wizard_header_get_title (
+ YGTK_WIZARD_HEADER (wizard->m_title));
char *title;
if (*_title == '\0')
- title = g_strdup (_("YaST"));
+ title = g_strdup ("YaST");
else
- title = g_strdup_printf (_("%s - YaST"), _title);
- GdkPixbuf *pixbuf = gtk_image_get_pixbuf (GTK_IMAGE (wizard->m_title_image));
+ title = g_strdup_printf ("%s - YaST", _title);
+ GdkPixbuf *pixbuf = ygtk_wizard_header_get_icon (
+ YGTK_WIZARD_HEADER (wizard->m_title));
gtk_window_set_title (GTK_WINDOW (window), title);
gtk_window_set_icon (GTK_WINDOW (window), pixbuf);
-
g_free (title);
}
}
void ygtk_wizard_set_header_text (YGtkWizard *wizard, const char *text)
{
- gtk_label_set_text (GTK_LABEL (wizard->m_title_label), text);
+ ygtk_wizard_header_set_title (YGTK_WIZARD_HEADER (wizard->m_title), text);
sync_window_title (wizard);
}
@@ -638,18 +709,12 @@
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file (icon, &error);
if (!pixbuf)
return FALSE;
- gtk_image_set_from_pixbuf (GTK_IMAGE (wizard->m_title_image), pixbuf);
+ ygtk_wizard_header_set_icon (YGTK_WIZARD_HEADER (wizard->m_title), pixbuf);
g_object_unref (G_OBJECT (pixbuf));
sync_window_title (wizard);
return TRUE;
}
-static void ygtk_wizard_map (GtkWidget *widget)
-{
- GTK_WIDGET_CLASS (ygtk_wizard_parent_class)->map (widget);
- sync_window_title (YGTK_WIZARD (widget));
-}
-
void ygtk_wizard_set_abort_button_label (YGtkWizard *wizard, const char *text)
{
gtk_button_set_label (GTK_BUTTON (wizard->m_abort_button), text);
@@ -774,8 +839,9 @@
{
if (!wizard->m_menu) {
wizard->m_menu = gtk_menu_bar_new();
- gtk_widget_set_parent (wizard->m_menu, GTK_WIDGET (wizard));
- gtk_widget_queue_draw (GTK_WIDGET (wizard));
+ gtk_container_add (GTK_CONTAINER (wizard->m_menu_box), wizard->m_menu);
+ // we probably want to hide the title, so the menu is more visible
+ gtk_widget_hide (wizard->m_title);
}
GtkWidget *entry = gtk_menu_item_new_with_mnemonic (text);
@@ -785,7 +851,7 @@
gtk_menu_item_set_submenu (GTK_MENU_ITEM (entry), submenu);
g_hash_table_insert (wizard->menu_ids, g_strdup (id), submenu);
- gtk_widget_show_all (wizard->m_menu);
+ gtk_widget_show_all (wizard->m_menu_box);
}
gboolean ygtk_wizard_add_menu_entry (YGtkWizard *wizard, const char *parent_id,
@@ -916,397 +982,12 @@
gtk_widget_set_sensitive (wizard->m_next_button, TRUE);
}
-static void ygtk_wizard_size_request (GtkWidget *widget, GtkRequisition *requisition)
-{
- YGtkWizard *wizard = YGTK_WIZARD (widget);
-
- gint border = GTK_CONTAINER (wizard)->border_width;
- gint child_border = wizard->child_border_width;
- gint header_padding = get_header_padding (GTK_WIDGET (wizard));
- gint content_padding = get_content_padding (GTK_WIDGET (wizard));
- GtkRequisition req; // temp usage
-
- requisition->width = 0;
- requisition->height = border * 2;
-
- if (wizard->m_menu) {
- gtk_widget_size_request (wizard->m_menu, &req);
- requisition->width = MAX (requisition->width, req.width);
- requisition->height += req.height;
- }
-
- // title
- gtk_widget_size_request (wizard->m_title, &req);
- req.width += header_padding * 2 + border*2;
- req.height += header_padding * 2;
-
- requisition->width = MAX (MIN (req.width, 40), requisition->width);
- requisition->height += req.height;
-
- // body
- {
- GtkRequisition nav_req, child_req;
-
- if (wizard->m_steps) {
- gtk_widget_size_request (wizard->m_steps, &nav_req);
- nav_req.width += content_padding * 2;
- nav_req.height += content_padding * 2;
- }
- else
- nav_req.width = nav_req.height = 0;
-
- GtkWidget *child = GTK_BIN (wizard)->child;
- if (child && GTK_WIDGET_VISIBLE (child))
- gtk_widget_size_request (child, &child_req);
- else
- child_req.width = child_req.height = 0;
- child_req.width += content_padding * 2 + child_border*2;
- child_req.height += content_padding * 2 + child_border*2;
-
- req.width = nav_req.width + child_req.width + border*2;
- req.height = MAX (nav_req.height, child_req.height);
-
- requisition->width = MAX (requisition->width, req.width);
- requisition->height += req.height;
- }
-
- // buttons
- gtk_widget_size_request (wizard->m_buttons, &req);
- req.width += border*2;
- req.height += BUTTONS_SPACING + border;
-
- requisition->width = MAX (requisition->width, req.width);
- requisition->height += req.height;
-}
-
-// helper -- applies padding to a GtkAllocation
-static inline void apply_allocation_padding (GtkAllocation *alloc, gint padding)
-{
- alloc->x += padding;
- alloc->y += padding;
- alloc->width -= padding * 2;
- alloc->height -= padding * 2;
-}
-
-static void ygtk_wizard_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
-{
- YGtkWizard *wizard = YGTK_WIZARD (widget);
-
- gint border = GTK_CONTAINER (wizard)->border_width;
- gint header_padding = get_header_padding (widget);
- gint content_padding = get_content_padding (widget);
- GtkRequisition req; // temp usage
- // we use "areas" because we need to do some tweaking when doing the actual
- // allocation and this makes it easier to place the other widgets.
- GtkAllocation menu_area, title_area, nav_area, child_area, buttons_area;
-
- // menu
- menu_area.x = allocation->x;
- menu_area.y = allocation->y;
- if (wizard->m_menu) {
- gtk_widget_get_child_requisition (wizard->m_menu, &req);
- menu_area.width = allocation->width;
- menu_area.height = req.height;
- }
- else
- menu_area.width = menu_area.height = 0;
-
- // title
- gtk_widget_get_child_requisition (wizard->m_title, &req);
- title_area.x = allocation->x + border;
- title_area.y = menu_area.y + menu_area.height + border;
- title_area.width = allocation->width - border*2;
- title_area.height = req.height + header_padding*2;
-
- // buttons
- gtk_widget_get_child_requisition (wizard->m_buttons, &req);
- buttons_area.x = title_area.x;
- buttons_area.y = (allocation->y + allocation->height) - req.height - border;
- buttons_area.width = title_area.width;
- buttons_area.height = req.height;
-
- // child (aka content aka containee)
- child_area.x = title_area.x;
- child_area.y = title_area.y + title_area.height;
- child_area.width = title_area.width;
- child_area.height = allocation->height - menu_area.height - title_area.height -
- buttons_area.height - border*2 - BUTTONS_SPACING;
-
- // navigation pane
- nav_area.x = child_area.x;
- nav_area.y = child_area.y;
- nav_area.height = child_area.height;
- if (wizard->m_steps) {
- gtk_widget_get_child_requisition (wizard->m_steps, &req);
- nav_area.width = req.width + content_padding*2;
-
- child_area.x += nav_area.width;
- child_area.width -= nav_area.width;
- /* // align to child
- title_area.x += nav_area.width;
- title_area.width -= nav_area.width;*/
- }
- else
- nav_area.width = 0;
-
- // Actual allocations
- // menu
- if (wizard->m_menu)
- gtk_widget_size_allocate (wizard->m_menu, &menu_area);
-
- // title
- apply_allocation_padding (&title_area, header_padding);
- gtk_widget_size_allocate (wizard->m_title, &title_area);
-
- // child
- GtkWidget *child = GTK_BIN (wizard)->child;
- if (child && GTK_WIDGET_VISIBLE (child)) {
- apply_allocation_padding (&child_area, content_padding + wizard->child_border_width);
- gtk_widget_size_allocate (child, &child_area);
- }
-
- // navigation pane
- if (wizard->m_steps) {
- apply_allocation_padding (&nav_area, content_padding);
- gtk_widget_size_allocate (wizard->m_steps, &nav_area);
- }
-
- // buttons
- gtk_widget_size_allocate (wizard->m_buttons, &buttons_area);
-
- GTK_WIDGET_CLASS (ygtk_wizard_parent_class)->size_allocate (widget, allocation);
-}
-
-static gboolean ygtk_wizard_expose_event (GtkWidget *widget, GdkEventExpose *event)
-{
- if (!GTK_WIDGET_DRAWABLE (widget))
- return FALSE;
- YGtkWizard *wizard = YGTK_WIZARD (widget);
-
- gint border = GTK_CONTAINER (wizard)->border_width;
- gint header_padding = get_header_padding (widget);
- gint content_padding = get_content_padding (widget);
-
- // paint a colored box
- cairo_t *cr = gdk_cairo_create (widget->window);
- int x, y, w, h;
-
- // (outer rectangle)
- x = border;
- y = border;
- w = widget->allocation.width - border*2;
- h = wizard->m_buttons->allocation.y - border - BUTTONS_SPACING;
- if (wizard->m_menu) {
- y += wizard->m_menu->allocation.height;
- h -= wizard->m_menu->allocation.height;
- }
-
- gdk_cairo_set_source_color (cr, &widget->style->bg [GTK_STATE_SELECTED]);
- cairo_rectangle (cr, x, y, w, h);
- cairo_fill (cr);
-
- // (inner rectangle)
- x += content_padding;
- w -= content_padding*2;
- y += wizard->m_title->allocation.height + header_padding*2 + content_padding;
- h -= wizard->m_title->allocation.height + header_padding*2 + content_padding*2;
- if (wizard->m_steps) {
- int steps_w = wizard->m_steps->allocation.width;
- x += steps_w + content_padding;
- w -= steps_w + content_padding;
- }
-
- gdk_cairo_set_source_color (cr, &widget->style->bg [GTK_STATE_NORMAL]);
- cairo_rectangle (cr, x, y, w, h);
- cairo_fill (cr);
-
- cairo_destroy (cr);
-
- // propagate expose
- GtkContainer *container = GTK_CONTAINER (wizard);
- if (wizard->m_menu)
- gtk_container_propagate_expose (container, wizard->m_menu, event);
- gtk_container_propagate_expose (container, wizard->m_title, event);
- if (wizard->m_steps)
- gtk_container_propagate_expose (container, wizard->m_steps, event);
- gtk_container_propagate_expose (container, wizard->m_buttons, event);
- if (GTK_BIN (container)->child)
- gtk_container_propagate_expose (container, GTK_BIN (container)->child, event);
- return TRUE;
-}
-
-static void ygtk_wizard_forall (GtkContainer *container, gboolean include_internals,
- GtkCallback callback, gpointer callback_data)
-{
- YGtkWizard *wizard = YGTK_WIZARD (container);
- if (include_internals) {
- (*callback) (wizard->m_title, callback_data);
- (*callback) (wizard->m_buttons, callback_data);
- if (wizard->m_menu)
- (*callback) (wizard->m_menu, callback_data);
- if (wizard->m_steps)
- (*callback) (wizard->m_steps, callback_data);
- }
-
- GtkWidget *containee = GTK_BIN (container)->child;
- if (containee)
- (*callback) (containee, callback_data);
-}
-
-//** Accessibility hooks
-
-static gint ygtk_wizard_accessible_get_n_children (AtkObject *accessible)
-{
- GtkWidget *widget = GTK_ACCESSIBLE (accessible)->widget;
- if (!widget)
- return 0;
- YGtkWizard *wizard = YGTK_WIZARD (widget);
- int nb = 1 /*content*/ + 5 /* buttons */;
- if (wizard->m_tree_view)
- nb++; /* side navigator */
- return nb;
-}
-
-static AtkObject *ygtk_wizard_accessible_ref_child (AtkObject *accessible, gint index)
-{
- GtkWidget *widget = GTK_ACCESSIBLE (accessible)->widget;
- if (!widget)
- return NULL;
- YGtkWizard *wizard = YGTK_WIZARD (widget);
- GtkWidget *child = 0;
- if (wizard->m_tree_view) {
- if (index == 0)
- child = wizard->m_tree_view;
- index--;
- }
- switch (index) {
- case 0:
- child = wizard->m_child;
- break;
- case 1:
- child = wizard->m_help_button;
- break;
- case 2:
- child = wizard->m_abort_button;
- break;
- case 3:
- child = wizard->m_back_button;
- break;
- case 4:
- child = wizard->m_next_button;
- break;
- case 5:
- if (GTK_WIDGET_VISIBLE (wizard->m_release_notes_button))
- child = wizard->m_release_notes_button;
- break;
- default:
- break;
- }
-
- if (child) {
- AtkObject *obj = gtk_widget_get_accessible (child);
- return g_object_ref (obj);
- }
- return NULL;
-}
-
-static void ygtk_wizard_accessible_class_init (AtkObjectClass *class)
-{
- class->get_n_children = ygtk_wizard_accessible_get_n_children;
- class->ref_child = ygtk_wizard_accessible_ref_child;
-}
-
-static GType ygtk_wizard_accessible_get_type (void)
-{
- static GType type = 0;
- if (!type) {
- GType derived_type = g_type_parent (YGTK_TYPE_WIZARD);
- AtkObjectFactory *factory;
- GType derived_atk_type;
- GTypeQuery query;
- factory = atk_registry_get_factory (atk_get_default_registry(), derived_type);
- derived_atk_type = atk_object_factory_get_accessible_type (factory);
- g_type_query (derived_atk_type, &query);
- type = g_type_register_static_simple (derived_atk_type,
- "YGtkWizardAccessible", query.class_size,
- (GClassInitFunc) ygtk_wizard_accessible_class_init, query.instance_size,
- NULL, 0);
- }
- return type;
-}
-
-static AtkObject *ygtk_wizard_accessible_new (GObject *obj)
-{
- g_return_val_if_fail (YGTK_IS_WIZARD (obj), NULL);
- AtkObject *accessible = g_object_new (ygtk_wizard_accessible_get_type (), NULL);
- atk_object_initialize (accessible, obj);
- return accessible;
-}
-
-static GType ygtk_wizard_accessible_factory_get_accessible_type (void)
-{
- return ygtk_wizard_accessible_get_type();
-}
-
-static AtkObject*ygtk_wizard_accessible_factory_create_accessible (GObject *obj)
-{
- return ygtk_wizard_accessible_new (obj);
-}
-
-static void ygtk_wizard_accessible_factory_class_init (AtkObjectFactoryClass *class)
-{
- class->create_accessible = ygtk_wizard_accessible_factory_create_accessible;
- class->get_accessible_type = ygtk_wizard_accessible_factory_get_accessible_type;
-}
-
-static GType ygtk_wizard_accessible_factory_get_type (void)
-{
- static GType type = 0;
- if (!type) {
- type = g_type_register_static_simple (ATK_TYPE_OBJECT_FACTORY,
- "YGtkWizardAccessibleFactory", sizeof (AtkObjectFactoryClass),
- (GClassInitFunc) ygtk_wizard_accessible_factory_class_init,
- sizeof (AtkObjectFactory), NULL, 0);
- }
- return type;
-}
-
-static AtkObject *ygtk_wizard_get_accessible (GtkWidget *widget)
-{
- static gboolean first_time = TRUE;
- if (first_time) {
- GType derived_type = g_type_parent (YGTK_TYPE_WIZARD);
- AtkRegistry *registry = atk_get_default_registry();
- AtkObjectFactory *factory;
- GType derived_atk_type;
- factory = atk_registry_get_factory (registry, derived_type);
- derived_atk_type = atk_object_factory_get_accessible_type (factory);
- if (g_type_is_a (derived_atk_type, GTK_TYPE_ACCESSIBLE)) {
- atk_registry_set_factory_type (registry, YGTK_TYPE_WIZARD,
- ygtk_wizard_accessible_factory_get_type());
- }
- first_time = FALSE;
- }
- return GTK_WIDGET_CLASS (ygtk_wizard_parent_class)->get_accessible (widget);
-}
-
static void ygtk_wizard_class_init (YGtkWizardClass *klass)
{
ygtk_wizard_parent_class = g_type_class_peek_parent (klass);
GtkWidgetClass* widget_class = GTK_WIDGET_CLASS (klass);
- //** Get expose, so we can draw line border
- widget_class->expose_event = ygtk_wizard_expose_event;
widget_class->realize = ygtk_wizard_realize;
- widget_class->size_request = ygtk_wizard_size_request;
- widget_class->size_allocate = ygtk_wizard_size_allocate;
- widget_class->get_accessible = ygtk_wizard_get_accessible;
- widget_class->map = ygtk_wizard_map;
-
- GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
- container_class->forall = ygtk_wizard_forall;
- container_class->add = ygtk_wizard_add_child;
- container_class->remove = ygtk_wizard_remove_child;
GtkObjectClass *gtkobject_class = GTK_OBJECT_CLASS (klass);
gtkobject_class->destroy = ygtk_wizard_destroy;
Modified: trunk/gtk/src/ygtkwizard.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkwizard.h?rev=49531&r…
==============================================================================
--- trunk/gtk/src/ygtkwizard.h (original)
+++ trunk/gtk/src/ygtkwizard.h Thu Jul 31 03:36:55 2008
@@ -11,8 +11,8 @@
#define YGTK_WIZARD_H
#include <gdk/gdk.h>
-#include <gtk/gtkbin.h>
#include <gtk/gtkwindow.h>
+#include <gtk/gtkvbox.h>
G_BEGIN_DECLS
// YGtkHelpDialog (for showing help text)
@@ -72,7 +72,7 @@
typedef struct _YGtkWizard
{
- GtkBin bin;
+ GtkVBox box;
// private:
/* Hash tables to assign Yast Ids to Gtk entries. */
@@ -80,26 +80,23 @@
GHashTable *tree_ids; /* gchar* -> GtkTreePath* */
GHashTable *steps_ids; /* gchar* -> guint */
- /* Widgets for layout. */
- GtkWidget *m_menu, *m_title, *m_steps, *m_tree, *m_buttons;
- GtkWidget *m_child, *m_pane;
- // containee can be accessed via GTK_BIN (wizard)->child
+ /* For layout */
+ GtkWidget *m_menu_box, *m_title, *m_contents_box, *m_control_bar,
+ *m_child, *m_pane, *m_buttons;
- /* Widgets we need to have access to. */
- GtkWidget *m_title_label, *m_title_image, *m_tree_view,
+ /* Widgets we need to access. */
+ GtkWidget *m_tree_view, *m_steps, *m_menu,
*m_back_button, *m_abort_button, *m_next_button, *m_help_button,
*m_release_notes_button;
/* The help text. */
gchar *m_help;
GtkWidget *m_help_dialog;
-
- guint child_border_width;
} YGtkWizard;
typedef struct _YGtkWizardClass
{
- GtkBinClass parent_class;
+ GtkVBoxClass parent_class;
// signals:
void (*action_triggered) (YGtkWizard *wizard, gpointer id, gint id_type);
@@ -117,6 +114,8 @@
// convinience method that removes the current child, if set, and swaps it by
// the given one (you may pass NULL to just remove current child)
void ygtk_wizard_set_child (YGtkWizard *wizard, GtkWidget *widget);
+void ygtk_wizard_set_information_widget (YGtkWizard *wizard, GtkWidget *widget);
+void ygtk_wizard_set_control_widget (YGtkWizard *wizard, GtkWidget *widget);
// commands
// (commands that may fail return a sucess boolean.)
Modified: trunk/gtk/src/ygtkzyppwrapper.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkzyppwrapper.cc?rev=4…
==============================================================================
--- trunk/gtk/src/ygtkzyppwrapper.cc (original)
+++ trunk/gtk/src/ygtkzyppwrapper.cc Thu Jul 31 03:36:55 2008
@@ -232,7 +232,6 @@
return GDK_TYPE_PIXBUF;
case YGtkZyppModel::NAME_COLUMN:
case YGtkZyppModel::NAME_DESCRIPTION_COLUMN:
- case YGtkZyppModel::PATTERN_DESCRIPTION_COLUMN:
return G_TYPE_STRING;
case YGtkZyppModel::PTR_COLUMN:
return G_TYPE_POINTER;
@@ -322,12 +321,6 @@
g_value_set_string (value, g_strdup (str.c_str()));
break;
}
- case YGtkZyppModel::PATTERN_DESCRIPTION_COLUMN:
- {
- std::string str (package->description());
- g_value_set_string (value, g_strdup (str.c_str()));
- break;
- }
case YGtkZyppModel::PTR_COLUMN:
{
void *ptr;
Modified: trunk/gtk/src/ygtkzyppwrapper.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkzyppwrapper.h?rev=49…
==============================================================================
--- trunk/gtk/src/ygtkzyppwrapper.h (original)
+++ trunk/gtk/src/ygtkzyppwrapper.h Thu Jul 31 03:36:55 2008
@@ -26,8 +26,7 @@
GObject parent;
enum Columns {
- ICON_COLUMN, NAME_COLUMN, NAME_DESCRIPTION_COLUMN,
- PATTERN_DESCRIPTION_COLUMN, PTR_COLUMN, TOTAL_COLUMNS
+ ICON_COLUMN, NAME_COLUMN, NAME_DESCRIPTION_COLUMN, PTR_COLUMN, TOTAL_COLUMNS
};
Ypp::Pool *pool;
Modified: trunk/gtk/src/yzyppwrapper.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/yzyppwrapper.cc?rev=4953…
==============================================================================
--- trunk/gtk/src/yzyppwrapper.cc (original)
+++ trunk/gtk/src/yzyppwrapper.cc Thu Jul 31 03:36:55 2008
@@ -85,16 +85,19 @@
Ypp::Node *add (const std::string &tree_str, const char *icon)
{
- const std::list <std::string> nodes_str = YGUtils::splitString (tree_str, delim);
+ const gchar delimiter[2] = { delim, '\0' };
+ gchar **nodes_str = g_strsplit (tree_str.c_str(), delimiter, -1);
+
GNode *parent = root, *sibling = 0;
Ypp::Node *ret = 0;
-
- std::list <std::string>::const_iterator it;
- for (it = nodes_str.begin(); it != nodes_str.end(); it++) {
+ gchar **i;
+ for (i = nodes_str; *i; i++) {
+ if (!**i)
+ continue;
bool found = false;
for (sibling = parent->children; sibling; sibling = sibling->next) {
Ypp::Node *yNode = (Ypp::Node *) sibling->data;
- int cmp = (*compare) (it->c_str(), yNode->name.c_str());
+ int cmp = (*compare) (*i, yNode->name.c_str());
if (cmp == 0) {
found = true;
ret = yNode;
@@ -108,10 +111,10 @@
parent = sibling;
}
- for (; it != nodes_str.end(); it++) {
+ for (; *i; i++) {
Ypp::Node *yNode = new Ypp::Node();
GNode *n = g_node_new ((void *) yNode);
- yNode->name = *it;
+ yNode->name = *i;
yNode->icon = icon;
yNode->impl = (void *) n;
g_node_insert_before (parent, sibling, n);
@@ -119,6 +122,7 @@
sibling = NULL;
ret = yNode;
}
+ g_strfreev (nodes_str);
return ret;
}
};
@@ -340,7 +344,7 @@
total++;
}
std::ostringstream stream;
- stream << "\n\n" << installed << " / " << total;
+ stream << "\n\n" << _("Installed: ") << installed << _(" of ") << total;
text += stream.str();
break;
}
@@ -477,6 +481,23 @@
return text;
}
+std::string Ypp::Package::icon()
+{
+ if (impl->type == PATTERN_TYPE) {
+ ZyppObject object = impl->zyppSel->theObj();
+ ZyppPattern pattern = tryCastToZyppPattern (object);
+ std::string icon = pattern->icon().asString().c_str();
+ // from yast2-qt: HACK most patterns have wrong default icon
+ if ((icon == zypp::Pathname("yast-system").asString()) || icon.empty())
+ icon = "pattern-generic";
+ // mine: remove start "./"
+ else if (icon.compare (0, 2, "./", 2) == 0)
+ icon.erase (0, 2);
+ return icon;
+ }
+ return "";
+}
+
bool Ypp::Package::isRecommended() const
{
return zypp::PoolItem (impl->zyppSel->theObj()).status().isRecommended();
@@ -749,7 +770,7 @@
{
Ypp::Package::Version *version = new Ypp::Package::Version();
version->number = object->edition().asString();
- version->number += " (" + object->arch().asString() + ")";
+ version->arch = object->arch().asString();
version->repo = ypp->impl->getRepository (object->repoInfo().alias());
version->cmp = 0;
version->impl = (void *) get_pointer (object);
@@ -774,7 +795,7 @@
version = new Ypp::Package::Version();
version->number = "5.0.6";
- version->number += " (i586)";
+ version->arch = "i586";
version->repo = 0;
version->cmp = 1;
version->impl = NULL;
@@ -782,7 +803,7 @@
version = new Ypp::Package::Version();
version->number = "4.1.2";
- version->number += " (i586)";
+ version->arch = "i586";
version->repo = 1;
version->cmp = -1;
version->impl = NULL;
@@ -866,6 +887,7 @@
Keys <Ypp::Package::Type> types;
Keys <std::string> names;
+ bool use_name, use_summary, use_description;
Keys <Node *> categories, categories2;
Keys <const Package *> collections;
Keys <const Repository *> repositories;
@@ -906,14 +928,18 @@
std::list <std::string>::const_iterator it;
for (it = values.begin(); it != values.end(); it++) {
const char *key = it->c_str();
- if (!strcasestr (package->name().c_str(), key) &&
- !strcasestr (package->summary().c_str(), key) &&
- !strcasestr (package->provides().c_str(), key)) {
+ bool str_match = false;
+ if (use_name)
+ str_match = strcasestr (package->name().c_str(), key);
+ if (!str_match && use_summary)
+ str_match = strcasestr (package->summary().c_str(), key);
+ if (!str_match && use_description)
+ str_match = strcasestr (package->description().c_str(), key);
+ if (!str_match) {
match = false;
break;
}
}
-
if (match && !highlight) {
if (values.size() == 1 && values.front() == package->name())
highlight = package;
@@ -983,16 +1009,21 @@
void Ypp::QueryPool::Query::addType (Ypp::Package::Type value)
{ impl->types.add (value); }
-void Ypp::QueryPool::Query::addNames (std::string value, char separator)
+void Ypp::QueryPool::Query::addNames (std::string value, char separator, bool use_name,
+ bool use_summary, bool use_description)
{
if (separator) {
- std::list <std::string> values = YGUtils::splitString (value, separator);
- for (std::list <std::string>::const_iterator it = values.begin();
- it != values.end(); it++)
- impl->names.add (*it);
+ const gchar delimiter[2] = { separator, '\0' };
+ gchar **names = g_strsplit (value.c_str(), delimiter, -1);
+ for (gchar **i = names; *i; i++)
+ impl->names.add (*i);
+ g_strfreev (names);
}
else
impl->names.add (value);
+ impl->use_name = use_name;
+ impl->use_summary = use_summary;
+ impl->use_description = use_description;
}
void Ypp::QueryPool::Query::addCategory (Ypp::Node *value)
{ impl->categories.add (value); }
@@ -1421,29 +1452,6 @@
return categories2->add (group_name, group_icon);
}
-// Maps icons to top package groups
-struct CategoriesIconMap {
- const char *category, *icon;
-};
-static const CategoriesIconMap catIconMap[] = {
- { "Amusements", "package_games" },
- { "Games", "package_games" },
- { "Applications", "package_system" },
- { "Development", "applications-development" },
- { "Libraries", "package_development" },
- { "Documentation", "package_documentation" },
- { "Hardware", "package_settings_peripherals" },
- { "Productivity", "package_applications" },
- { "System", "applications-system" },
- { "Multimedia", "package_multimedia" },
- { "Video", "package_multimedia" },
- { "Office", "applications-office" },
- { "Publishing", "applications-office" },
- { "X11", "applications-other" },
- { "Metapackages", "package_network" },
-};
-#define CAT_SIZE (sizeof (catIconMap)/sizeof (CategoriesIconMap))
-
void Ypp::Impl::polishCategories (Ypp::Package::Type type)
{
// some treatment on categories
@@ -1470,15 +1478,6 @@
}
}
}
-
- Node *first = categories [Package::PACKAGE_TYPE]->getFirst();
- for (Node *n = first; n; n = n->next()) {
- for (unsigned int i = 0; i < CAT_SIZE; i++)
- if (n->name == catIconMap[i].category) {
- n->icon = catIconMap[i].icon;
- break;
- }
- }
}
}
@@ -1526,12 +1525,13 @@
std::list <zypp::RepoInfo> zrepos = manager.knownRepositories();
for (std::list <zypp::RepoInfo>::const_iterator it = zrepos.begin();
it != zrepos.end(); it++) {
- if (it->enabled()) {
- Repository *repo = new Repository();
- repo->name = it->name();
- repo->alias = it->alias();
- repos = g_slist_append (repos, repo);
- }
+ Repository *repo = new Repository();
+ repo->name = it->name();
+ if (!it->baseUrlsEmpty())
+ repo->url = it->baseUrlsBegin()->asString();
+ repo->alias = it->alias();
+ repo->enabled = it->enabled();
+ repos = g_slist_append (repos, repo);
}
}
return (Repository *) g_slist_nth_data (repos, nb);
Modified: trunk/gtk/src/yzyppwrapper.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/yzyppwrapper.h?rev=49531…
==============================================================================
--- trunk/gtk/src/yzyppwrapper.h (original)
+++ trunk/gtk/src/yzyppwrapper.h Thu Jul 31 03:36:55 2008
@@ -55,6 +55,7 @@
std::string filelist();
std::string changelog();
std::string authors();
+ std::string icon();
bool isRecommended() const;
bool isSuggested() const;
@@ -62,7 +63,7 @@
std::string requires() const;
struct Version {
- std::string number;
+ std::string number, arch;
const Repository *repo;
int cmp /* relatively to installed -- ignore if not installed */;
void *impl;
@@ -134,11 +135,12 @@
struct Query {
Query();
void addType (Package::Type type);
- void addNames (std::string name, char separator = 0);
+ void addNames (std::string name, char separator = 0, bool use_name = true,
+ bool use_summary = true, bool use_description = false);
void addCategory (Ypp::Node *category);
void addCategory2 (Ypp::Node *category);
void addCollection (const Ypp::Package *package);
- void addRepository (const Ypp::Repository *repositories);
+ void addRepository (const Ypp::Repository *repository);
void setIsInstalled (bool installed);
void setHasUpgrade (bool upgradable);
void setIsModified (bool modified);
@@ -221,10 +223,11 @@
// Repositories
struct Repository {
- std::string name, alias /*internal use*/;
+ std::string name, url, alias /*internal use*/;
+ bool enabled;
};
const Repository *getRepository (int nb);
- void setFavoriteRepository (const Repository *repo); /* -1 to disable restrictions */
+ void setFavoriteRepository (const Repository *repo); /* 0 to disable restrictions */
const Repository *favoriteRepository();
// Misc
@@ -233,8 +236,7 @@
Node *getFirstCategory (Package::Type type);
Node *getFirstCategory2 (Package::Type type);
- struct Disk
- {
+ struct Disk {
struct Partition {
std::string path, used_str, total_str;
long long used, total;
--
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] r49530 - in /branches/tmp/dmacvicar/yast-xmlui/libyui: examples/Makefile.am examples/XMLLoad.cc examples/yuixml/ examples/yuixml/example-1.xml src/Makefile.am src/YUIXMLReader.cc src/YUIXMLReader.h
by dmacvicar@svn.opensuse.org 30 Jul '08
by dmacvicar@svn.opensuse.org 30 Jul '08
30 Jul '08
Author: dmacvicar
Date: Wed Jul 30 18:39:03 2008
New Revision: 49530
URL: http://svn.opensuse.org/viewcvs/yast?rev=49530&view=rev
Log:
fork reader to support a 1:1 xml representation
Added:
branches/tmp/dmacvicar/yast-xmlui/libyui/examples/XMLLoad.cc
branches/tmp/dmacvicar/yast-xmlui/libyui/examples/yuixml/
branches/tmp/dmacvicar/yast-xmlui/libyui/examples/yuixml/example-1.xml
branches/tmp/dmacvicar/yast-xmlui/libyui/src/YUIXMLReader.cc
branches/tmp/dmacvicar/yast-xmlui/libyui/src/YUIXMLReader.h
Modified:
branches/tmp/dmacvicar/yast-xmlui/libyui/examples/Makefile.am
branches/tmp/dmacvicar/yast-xmlui/libyui/src/Makefile.am
Modified: branches/tmp/dmacvicar/yast-xmlui/libyui/examples/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/examples/Makefile.am (original)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/examples/Makefile.am Wed Jul 30 18:39:03 2008
@@ -7,6 +7,7 @@
noinst_PROGRAMS = \
HelloWorld \
XULLoad \
+ XMLLoad \
ComboBox1 \
ComboBox1-editable \
SelectionBox1 \
@@ -20,6 +21,9 @@
XULLoad_SOURCES = XULLoad.cc
XULLoad_LDADD = -L$(top_srcdir)/src -lyui
+XMLLoad_SOURCES = XMLLoad.cc
+XMLLoad_LDADD = -L$(top_srcdir)/src -lyui
+
ComboBox1_SOURCES = ComboBox1.cc
ComboBox1_LDADD = -L$(top_srcdir)/src -lyui
Added: branches/tmp/dmacvicar/yast-xmlui/libyui/examples/XMLLoad.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/examples/XMLLoad.cc (added)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/examples/XMLLoad.cc Wed Jul 30 18:39:03 2008
@@ -0,0 +1,20 @@
+// Trivial libyui example.
+//
+// Compile with:
+//
+// g++ -I/usr/include/YaST2/yui -lyui HelloWorld.cc -o HelloWorld
+
+#include "YUI.h"
+#include "YUIXMLReader.h"
+
+#include "YWidgetFactory.h"
+#include "YDialog.h"
+#include "YLayoutBox.h"
+#include "YEvent.h"
+
+int main( int argc, char **argv )
+{
+ YDialog *dialog = YUIXMLReader::readDialogFromFile( argv[1] );
+ dialog->waitForEvent();
+ dialog->destroy();
+}
Added: branches/tmp/dmacvicar/yast-xmlui/libyui/examples/yuixml/example-1.xml
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/examples/yuixml/example-1.xml (added)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/examples/yuixml/example-1.xml Wed Jul 30 18:39:03 2008
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<dialog id="example" xmlns="http://www.opensuse.org/YaST/YUIXML">
+ <hbox>
+ <pushbutton id="hello" label="Hello"/>
+ <pushbutton id="bye" label="Bye"/>
+ </hbox>
+</dialog>
+
+
+
Modified: branches/tmp/dmacvicar/yast-xmlui/libyui/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/src/Makefile.am (original)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/src/Makefile.am Wed Jul 30 18:39:03 2008
@@ -90,7 +90,7 @@
YStringTree.cc \
YRpmGroupsTree.cc \
\
- YUIXULReader.cc \
+ YUIXMLReader.cc \
xmlsp/xmlsp.cpp \
xmlsp/xmlsp_dom.cpp
@@ -182,7 +182,7 @@
YRpmGroupsTree.h \
YStringTree.h \
YTransText.h \
- YUIXULReader.h
+ YUIXMLReader.h
CLEANFILES = libyui.kdoc $(BUILT_SOURCES)
Added: branches/tmp/dmacvicar/yast-xmlui/libyui/src/YUIXMLReader.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/src/YUIXMLReader.cc (added)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/src/YUIXMLReader.cc Wed Jul 30 18:39:03 2008
@@ -0,0 +1,785 @@
+
+#include <cstring>
+#include <sstream>
+#include <fstream>
+#include <iostream>
+#include "xmlsp/xmlsp_dom.h"
+
+#include "YUI.h"
+
+#define YUILogComponent "YUIXULReader"
+#include "YUILog.h"
+
+#include "YUISymbols.h"
+
+#include "YWidgetFactory.h"
+#include "YItem.h"
+#include "YWidgetID.h"
+#include "YImage.h"
+#include "YDialog.h"
+#include "YLayoutBox.h"
+#include "YFrame.h"
+#include "YCheckBox.h"
+#include "YIntField.h"
+#include "YInputField.h"
+#include "YMultiLineEdit.h"
+#include "YPushButton.h"
+#include "YRadioButton.h"
+#include "YRadioButtonGroup.h"
+#include "YSelectionBox.h"
+#include "YMultiSelectionBox.h"
+#include "YLabel.h"
+#include "YProgressBar.h"
+#include "YComboBox.h"
+
+#include "YUIXMLReader.h"
+
+using namespace std;
+using namespace XMLSP;
+
+inline bool namecmp( const std::string &s1,
+ const std::string &s2 )
+{
+ return ::strcasecmp(s1.c_str(), s2.c_str()) == 0;
+}
+
+
+
+/**
+ * Widget ID class based on string.
+ **/
+class StringWidgetID: public YWidgetID
+{
+public:
+ /**
+ * Constructor.
+ **/
+ StringWidgetID( const string &value )
+ : _value(value)
+ {}
+
+ /**
+ * Check if this ID is equal to another.
+ *
+ * Reimplemented from YWidgetID.
+ **/
+ virtual bool isEqual( YWidgetID * otherID ) const
+ { return otherID->toString() == _value; }
+
+ /**
+ * Convert the ID value to string.
+ * Used for logging and debugging.
+ *
+ * Reimplemented from YWidgetID.
+ **/
+ virtual string toString() const
+ { return _value; }
+private:
+ string _value;
+};
+
+
+string dumpAttributes(XMLSP::DOMElement* e)
+{
+ stringstream s;
+ XMLSP::DOMStringList list = e->getAttributeList();
+ XMLSP::DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++) {
+ s<<" "<<*i<<"=\""<<e->getAttribute(*i)<<"\"";
+ }
+ return s.str();
+}
+
+
+void dumpElement(XMLSP::DOMElement* e, int depth)
+{
+ string p1, p2;
+ XMLSP::DOMElements els;
+ XMLSP::DOMElements::iterator i;
+
+
+ p1.assign((depth-1)*4, ' ');
+ p2.assign(depth*4, ' ');
+
+ cout<<p1<<"[element] {"<<endl;
+ cout<<p2<<"name: "<<e->getElementName()<<endl;
+ if (e->attributeCount())
+ cout<<p2<<"attributes:"<<dumpAttributes(e)<<endl;
+
+
+ if (e->hasChilds()) {
+ cout<<p2<<"childs count: "<<e->childCount()<<endl;
+
+ els = e->getChilds();
+ for(i = els.begin(); i != els.end(); i++) {
+ dumpElement(*i, depth+1);
+ }
+ } else if (e->getCData().size()) {
+ cout<<p2<<"cdata: "<<e->getCData()<<endl;
+ }
+
+
+ cout<<p1<<"}"<<endl;
+}
+
+inline int convertToInt(const std::string& s)
+{
+ std::istringstream i(s);
+ int x;
+ if (!(i >> x))
+ YUI_THROW(YUIException("can't convert string \"" + s + "\" to integer"));
+ return x;
+}
+
+inline bool convertToBool(const std::string& s)
+{
+ if ( s == "true" )
+ return true;
+ else if (s == "false" )
+ return false;
+ else
+ YUI_THROW(YUIException("can't convert string \"" + s + "\" to boolean"));
+}
+
+
+// forward declarations
+static YWidget * parseCheckbox( YWidget *parent, DOMElement *root );
+static YWidget * parseComboBox( YWidget *parent, DOMElement *root );
+static YWidget * parseLabel( YWidget *parent, DOMElement *root );
+static YWidget * parseMultiSelectionBox( YWidget *parent, DOMElement *root );
+static YWidget * parseProgressBar( YWidget *parent, DOMElement *root );
+static YWidget * parseRadioButtonGroup( YWidget *parent, DOMElement *root );
+static YWidget * parseRadioButton( YWidget *parent, DOMElement *root );
+static YWidget * parseSelectionBox( YWidget *parent, DOMElement *root );
+static YWidget * parseCaption( YWidget *parent, DOMElement *root );
+static YWidget * parseFrame( YWidget *parent, DOMElement *root );
+static YWidget * parseTextbox( YWidget *parent, DOMElement *root );
+static YWidget * parseImage( YWidget *parent, DOMElement *root );
+static YWidget * parsePushButton( YWidget *parent, DOMElement *root );
+static YWidget * parseHBox( YWidget *parent, DOMElement *root );
+static YWidget * parseVBox( YWidget *parent, DOMElement *root );
+static YWidget * parseDialog( YWidget *parent, DOMElement *root );
+static YWidget * parseNode( YWidget *parent, DOMElement *root );
+static void parseChildren( YWidget *parent, DOMElement *root );
+static YItemCollection parseItemList( const string &tagname, YWidget *parent, DOMElement *root );
+static YItem parseItem( const string &tagname, YWidget *parent, DOMElement *root );
+
+static YWidget *
+parseProgressBar( YWidget *parent, DOMElement *root )
+{
+ int value = 0;
+ int maxValue = 100;
+ string mode = "determined";
+ string label;
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "mode" )
+ mode = root->getAttribute(*i);
+ else if ( *i == "value" )
+ value = convertToInt(root->getAttribute(*i));
+ }
+
+ YProgressBar * progressBar = YUI::widgetFactory()->createProgressBar( parent, label, maxValue );
+ if ( value > 0 )
+ progressBar->setValue( value );
+ return progressBar;
+}
+
+
+static YItem
+parseItem( const string &tagname, YWidget *parent, DOMElement *root )
+{
+ if ( root->getElementName() != tagname )
+ {
+ YUI_THROW(YUIException("Invalid item '" + root->getElementName() + "'"));
+ }
+
+ string label;
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "label" )
+ label = root->getAttribute(*i);
+ }
+
+ YItem item(label);
+ return item;
+}
+
+
+static YItemCollection
+parseItemList( const string &tagname, YWidget *parent, DOMElement *root )
+{
+ YItemCollection itemCollection;
+ itemCollection.reserve( root->childCount() );
+
+ try
+ {
+ DOMElements els;
+ DOMElements::iterator i;
+
+ if (root->hasChilds())
+ {
+ els = root->getChilds();
+ for(i = els.begin(); i != els.end(); i++)
+ {
+ // FIXME, lbyui does not support this
+ if ( (*i)->getElementName() == "menuseparator" )
+ continue;
+
+ YItem item = parseItem( tagname, parent, *i );
+ }
+ }
+ }
+ catch ( YUIException & exception )
+ {
+ // Delete all items created so far
+ YItemIterator it = itemCollection.begin();
+
+ while ( it != itemCollection.end() )
+ {
+ YItem * item = *it;
+ ++it;
+ delete item;
+ }
+ throw;
+ }
+ return itemCollection;
+}
+
+static YWidget *
+parseLabel( YWidget *parent, DOMElement *root )
+{
+ string value;
+ bool isOutputField = false;
+ bool isHeading = false;
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "value" )
+ value = root->getAttribute(*i);
+ }
+ YLabel * label = YUI::widgetFactory()->createLabel( parent, value, isHeading, isOutputField );
+ return label;
+}
+
+static YWidget *
+parseComboBox( YWidget *parent, DOMElement *root )
+{
+ // FIXME XUL has no label here
+ string label;
+ bool editable = false;
+
+ // get the attributes
+ {
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "label" )
+ label = root->getAttribute(*i);
+ else if ( *i == "editable" )
+ editable = ( root->getAttribute(*i) == "true" );
+ }
+ }
+
+ YComboBox * comboBox = YUI::widgetFactory()->createComboBox( parent, label, editable );
+
+ // sadly the menulist element has a menupopup element
+ // which contains the menutem elements
+ {
+
+ DOMElements els;
+ DOMElements::iterator i;
+
+ if (root->hasChilds())
+ {
+ els = root->getChilds();
+ for(i = els.begin(); i != els.end(); i++)
+ {
+ if ( (*i)->getElementName() == "menupopup" )
+ {
+ comboBox->addItems( parseItemList( "menuitem", comboBox, *i ) );
+ }
+ }
+ }
+ }
+ return comboBox;
+}
+
+
+static YWidget *
+parseSelectionBox( YWidget *parent, DOMElement *root )
+{
+ string seltype = "single";
+
+ // FIXME XUL has no label here
+ string label;
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "seltype" )
+ seltype = root->getAttribute(*i);
+ }
+
+ YSelectionBox *selBox = YUI::widgetFactory()->createSelectionBox( parent, label );
+ selBox->addItems( parseItemList( "listitem", selBox, root ) );
+ return selBox;
+}
+
+static YWidget *
+parseMultiSelectionBox( YWidget *parent, DOMElement *root )
+{
+ string seltype = "single";
+
+ // FIXME XUL has no label here
+ string label;
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "seltype" )
+ seltype = root->getAttribute(*i);
+ }
+
+ YMultiSelectionBox * mselBox = YUI::widgetFactory()->createMultiSelectionBox( parent, label );
+ mselBox->addItems( parseItemList( "listitem", mselBox, root ) );
+ return mselBox;
+}
+
+
+static YWidget *
+parseRadioButtonGroup( YWidget *parent, DOMElement *root )
+{
+ // vertical by default
+ string orient = "vertical";
+
+ YRadioButtonGroup * radioButtonGroup = YUI::widgetFactory()->createRadioButtonGroup( parent );
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "orient" )
+ orient = root->getAttribute(*i);
+ }
+
+ YLayoutBox *box;
+
+ if ( orient == "horizontal" )
+ box = YUI::widgetFactory()->createHBox(radioButtonGroup);
+ else
+ box = YUI::widgetFactory()->createVBox(radioButtonGroup);
+
+ parseChildren( box, root );
+
+ return radioButtonGroup;
+}
+
+static YWidget *
+parseRadioButton( YWidget *parent, DOMElement *root )
+{
+ string label;
+ string value;
+ bool selected = false;
+ bool disabled = false;
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "selected" )
+ selected = ( root->getAttribute(*i) == "true" );
+ if ( *i == "label" )
+ label = root->getAttribute(*i);
+ if ( *i == "disabled" )
+ disabled = ( root->getAttribute(*i) == "true" );
+ }
+
+ YRadioButton * radioButton = YUI::widgetFactory()->createRadioButton( parent, label, selected );
+ return radioButton;
+}
+
+
+
+/**
+ * Sets the caption of a groupbox
+ * <caption label="..."/>
+ */
+static YWidget * parseCaption( YWidget *parent, DOMElement *root )
+{
+ return 0L;
+}
+
+/**
+ * parses a YFrame from XUL
+ * <groupbox>
+ * <caption label="Network"/>
+ * </groupbox>
+ */
+static YWidget *
+parseFrame( YWidget *parent, DOMElement *root )
+{
+ // FIXME children <caption> sets the label
+ string label;
+
+ // vertical by default
+ string orient = "vertical";
+
+ YFrame * frame = YUI::widgetFactory()->createFrame( parent, label );
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "orient" )
+ orient = root->getAttribute(*i);
+ }
+
+ YLayoutBox *box;
+
+ if ( orient == "horizontal" )
+ box = YUI::widgetFactory()->createHBox(frame);
+ else
+ box = YUI::widgetFactory()->createVBox(frame);
+
+ parseChildren( box, root );
+
+ return frame;
+}
+
+/**
+ * parses a YIntField from XUL
+ * <textbox type="..."/>
+ */
+static YWidget *
+parseTextbox( YWidget *parent, DOMElement *root )
+{
+ // type of textbox
+ string type = "normal";
+
+ // for type number
+ int min = 0;
+ int max = 0;
+ int int_value = 0;
+
+ // for normal type
+ bool multiline = false;
+ string value;
+
+ // FIXME
+ string label;
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "type" )
+ type = root->getAttribute(*i);
+ if ( *i == "multiline" )
+ multiline = ( root->getAttribute(*i) == "true" );
+ if ( *i == "max" )
+ max = convertToInt(root->getAttribute(*i));
+ if ( *i == "min" )
+ min = convertToInt(root->getAttribute(*i));
+ }
+
+ if ( type == "number" )
+ {
+ if ( !value.empty() )
+ int_value = convertToInt(value);
+ return YUI::widgetFactory()->createIntField( parent, label, min, max, int_value );
+ }
+ else if ( type == "password" )
+ {
+ return YUI::widgetFactory()->createInputField( parent, label, true );
+ }
+ else
+ {
+ if ( multiline )
+ {
+ YMultiLineEdit *edit = YUI::widgetFactory()->createMultiLineEdit( parent, label );
+ if ( ! value.empty() )
+ edit->setValue( value );
+ return edit;
+ }
+
+ return YUI::widgetFactory()->createInputField( parent, label, false );
+ }
+
+ return 0L;
+}
+
+/**
+ * parses a YImage from XUL
+ * <image src="start.png"/>
+ */
+static YWidget *
+parseImage( YWidget *parent, DOMElement *root )
+{
+ string imageFileName;
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "src" )
+ imageFileName = root->getAttribute(*i);
+ }
+
+ YImage *image = YUI::widgetFactory()->createImage( parent, imageFileName, false);
+ return image;
+}
+
+
+/**
+ * parses a YPushCheckBox from XUL
+ * <checkbox>
+ */
+static YWidget *
+parseCheckbox( YWidget *parent, DOMElement *root )
+{
+ bool checked = false;
+ string label;
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "checked" )
+ checked = ( root->getAttribute(*i) == "true" );
+ if ( *i == "label" )
+ label = root->getAttribute(*i);
+ }
+
+ YCheckBox *checkbox = YUI::widgetFactory()->createCheckBox( parent, label, checked );
+ return checkbox;
+}
+
+/**
+ * parses a YPushButton from XUL
+ * <button>
+ */
+static YWidget *
+parsePushButton( YWidget *parent, DOMElement *root )
+{
+ string label;
+ string iconname;
+
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "label" )
+ label = root->getAttribute(*i);
+ }
+
+ YPushButton *button = YUI::widgetFactory()->createPushButton( parent, label );
+ return button;
+}
+
+/**
+ * parses a YLayoutBox from XUL
+ * <hbox>
+ */
+static YWidget *
+parseHBox( YWidget *parent, DOMElement *root )
+{
+ YLayoutBox *hbox = YUI::widgetFactory()->createHBox(parent);
+
+ parseChildren( hbox, root );
+
+ return hbox;
+}
+
+/**
+ * parses a YLayoutBox from XUL
+ * <vbox>
+ */
+static YWidget *
+parseVBox( YWidget *parent, DOMElement *root )
+{
+ YLayoutBox *vbox = YUI::widgetFactory()->createVBox(parent);
+
+ parseChildren( vbox, root );
+
+ return vbox;
+}
+
+/**
+ * parses a YDialog from XUL
+ * <window>
+ */
+static YWidget *
+parseDialog( YWidget *parent, DOMElement *root )
+{
+ YDialog *dialog = YUI::widgetFactory()->createPopupDialog();
+
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ //if ( *i == "orient" )
+ // orient = root->getAttribute(*i);
+ }
+
+ parseChildren( dialog, root );
+
+ return dialog;
+}
+
+/**
+ * iterates over all children and parses them
+ */
+static void
+parseChildren( YWidget *parent, DOMElement *root )
+{
+ DOMElements els;
+ DOMElements::iterator i;
+
+ if (root->hasChilds())
+ {
+ els = root->getChilds();
+ for(i = els.begin(); i != els.end(); i++)
+ {
+ parseNode( parent, *i );
+ }
+ }
+}
+
+/**
+ * Find out which parser function to call
+ * given the element
+ *
+ * also sets the widget basic properties
+ * like id.
+ */
+static YWidget *
+parseNode( YWidget *parent, DOMElement *root )
+{
+ string name = root->getElementName();
+ YWidget *w = 0L;
+
+ if ( namecmp( name, "dialog" ) )
+ w = parseDialog( parent, root );
+ else if ( namecmp( name, YUIWidget_CheckBox ) )
+ w = parseCheckbox( parent, root );
+ else if ( namecmp( name, YUIWidget_ComboBox ) )
+ w = parseComboBox( parent, root );
+ else if ( namecmp( name, YUIWidget_HBox ) )
+ w = parseHBox( parent, root );
+ else if ( namecmp( name, YUIWidget_Label ) )
+ w = parseLabel( parent, root );
+ else if ( namecmp( name, YUIWidget_ProgressBar ) )
+ w = parseProgressBar( parent, root );
+ else if ( namecmp( name, YUIWidget_PushButton ) )
+ w = parsePushButton( parent, root );
+ else if ( namecmp( name, YUIWidget_SelectionBox ) )
+ w = parseSelectionBox( parent, root );
+ else if ( namecmp( name, YUIWidget_MultiSelectionBox ) )
+ w = parseMultiSelectionBox( parent, root );
+ else if ( namecmp( name, YUIWidget_RadioButton ) )
+ w = parseRadioButton( parent, root );
+ else if ( namecmp( name, YUIWidget_RadioButtonGroup ) )
+ w = parseRadioButtonGroup( parent, root );
+ else if ( namecmp( name, YUIWidget_Frame ) )
+ w = parseFrame( parent, root );
+ else if ( name == "textbox" )
+ w = parseTextbox( parent, root );
+ else if ( name == "image" )
+ w = parseImage( parent, root );
+ else if ( namecmp( name, YUIWidget_VBox ) )
+ w = parseVBox( parent, root );
+
+ if ( ! w )
+ {
+ yuiError() << "widget `" << name << "' not supported" << endl;
+// YUI_THROW(YUIException("widget '" + name + "' not supported"));
+ }
+ else
+ {
+
+ // set the id of the widget
+ DOMStringList list = root->getAttributeList();
+ DOMStringList::iterator i;
+ for (i = list.begin(); i != list.end(); i++)
+ {
+ if ( *i == "id" )
+ w->setId( new StringWidgetID(root->getAttribute(*i)) );
+ }
+ }
+
+ return w;
+}
+
+
+YDialog *
+YUIXMLReader::readDialogFromFile( const string &filename )
+{
+ FILE * pFile;
+ long lSize;
+ char * buffer;
+ size_t result;
+
+ pFile = fopen ( filename.c_str() , "rb" );
+ if (pFile==NULL)
+ YUI_THROW(YUIException("File error"));
+
+ // obtain file size:
+ fseek (pFile , 0 , SEEK_END);
+ lSize = ftell (pFile);
+ rewind (pFile);
+
+ // allocate memory to contain the whole file:
+ buffer = (char*) malloc (sizeof(char)*lSize);
+ if (buffer == NULL)
+ YUI_THROW(YUIException("Memory error"));
+
+ // copy the file into the buffer:
+ result = fread (buffer,1,lSize,pFile);
+ if (result != (size_t) lSize)
+ YUI_THROW(YUIException("Reading error"));
+
+ /* the whole file is now loaded in the memory buffer. */
+
+ DOMElement* root;
+ root = DOMElement::loadXML(buffer);
+ if (root == NULL)
+ {
+
+ YUI_THROW(YUIException("Failed to parse dialog from xml file" + DOMElement::getLastError()));
+
+ }
+ else
+ {
+ yuiMilestone() << filename << " xml parsed correctly" << endl;
+ YWidget *w = parseNode( 0L, root );
+
+ YDialog *dialog = dynamic_cast<YDialog *>(w);
+ if ( ! dialog )
+ {
+ YUI_THROW(YUINoDialogException());
+ }
+ yuiMilestone() << "built dialog from " << filename << " correctly" << endl;
+ delete root;
+ return dialog;
+ }
+
+ // terminate
+ fclose (pFile);
+ free (buffer);
+
+ return 0L;
+}
Added: branches/tmp/dmacvicar/yast-xmlui/libyui/src/YUIXMLReader.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/yast-xmlui/liby…
==============================================================================
--- branches/tmp/dmacvicar/yast-xmlui/libyui/src/YUIXMLReader.h (added)
+++ branches/tmp/dmacvicar/yast-xmlui/libyui/src/YUIXMLReader.h Wed Jul 30 18:39:03 2008
@@ -0,0 +1,30 @@
+
+#ifndef YUIXMLReader_h
+#define YUIXMLReader_h
+
+#include <string>
+
+class YDialog;
+
+/**
+ * Build YUI dialogs from XUL (http://www.mozilla.org/projects/xul/)
+ * descriptions.
+ *
+ *
+ */
+class YUIXMLReader
+{
+ public:
+ /**
+ * Reads a YUI dialog from a XUL file
+ *
+ * 'filename' : the .xul file to read
+ *
+ * throws YUINoDialogException if the file does not
+ * contain a dialog.
+ */
+ static YDialog * readDialogFromFile( const std::string &filename );
+};
+
+
+#endif
--
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] r49529 - /trunk/libyui-bindings/swig/python/examples/utf8.py
by kkaempf@svn.opensuse.org 30 Jul '08
by kkaempf@svn.opensuse.org 30 Jul '08
30 Jul '08
Author: kkaempf
Date: Wed Jul 30 16:27:30 2008
New Revision: 49529
URL: http://svn.opensuse.org/viewcvs/yast?rev=49529&view=rev
Log:
fix utf-8 for ncurses
Modified:
trunk/libyui-bindings/swig/python/examples/utf8.py
Modified: trunk/libyui-bindings/swig/python/examples/utf8.py
URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui-bindings/swig/python/exam…
==============================================================================
--- trunk/libyui-bindings/swig/python/examples/utf8.py (original)
+++ trunk/libyui-bindings/swig/python/examples/utf8.py Wed Jul 30 16:27:30 2008
@@ -7,6 +7,13 @@
import sys
sys.path.insert(0,'../../../build/bindings/python')
+
+# see http://svn.opensuse.org/svn/yast/trunk/ncurses/src/YNCursesUI.cc
+# approx line 67
+# this call is usually done by YaSTs 'WFM'
+import locale
+locale.setlocale(locale.LC_ALL, "")
+
import yui
log = yui.YUILog.instance()
--
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] r49528 - /branches/tmp/aschnell/part-redesign/storage/src/modules/StorageFields.ycp
by aschnell@svn.opensuse.org 30 Jul '08
by aschnell@svn.opensuse.org 30 Jul '08
30 Jul '08
Author: aschnell
Date: Wed Jul 30 16:11:07 2008
New Revision: 49528
URL: http://svn.opensuse.org/viewcvs/yast?rev=49528&view=rev
Log:
- cleanup
Modified:
branches/tmp/aschnell/part-redesign/storage/src/modules/StorageFields.ycp
Modified: branches/tmp/aschnell/part-redesign/storage/src/modules/StorageFields.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/st…
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/modules/StorageFields.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/modules/StorageFields.ycp Wed Jul 30 16:11:07 2008
@@ -670,52 +670,25 @@
boolean real_disk = Storage::IsPartitionable(disk);
symbol type = disk["type"]:`CT_UNKNOWN;
- if( !(type==`CT_DISK && !real_disk) &&
- (type==`CT_DISK || type==`CT_DMRAID || type==`CT_LVM ||
- (type==`CT_EVMS && size(disk["name"]:"")>0 &&
- (!haskey(target_map, "/dev/"+substring(disk["name"]:"", search( disk["name"]:"", "/")+1))||
- disk["create"]:false))))
- return false;
+ if (type == `CT_DISK && !real_disk)
+ return true;
- return true;
+ if (!contains([ `CT_DISK, `CT_DMRAID, `CT_LVM ], type))
+ return true;
+
+ return false;
}
global boolean AlwaysHidePartition(map<string, map> target_map, map disk, map partition)
{
- boolean hide = partition["fsid"]:0 == Partitions::fsid_mac_hidden ||
- disk["used_by_type"]:`UB_NONE==`UB_DMRAID;
+ if (partition["fsid"]:0 == Partitions::fsid_mac_hidden)
+ return true;
- if( !hide && search( partition["device"]:"", "/dev/evms/" )==0 )
- {
- y2milestone( "evms p: %1", partition );
- string d1 = Storage::EvmsDevDisk(partition["device"]:"");
- y2milestone( "evms d1:%1", d1 );
- integer val = search( d1, "/lvm/" );
- if( val!=nil && val>0 )
- {
- d1 = "/dev/" + substring( d1, 9 );
- }
- else
- {
- val = search( d1, "/lvm2/" );
- if( val!=nil && val>0 )
- {
- d1 = "/dev/" + substring( d1, 10 );
- }
- }
- hide = size(partition["mount"]:"")==0;
- if( hide )
- {
- y2milestone( "evms p: %1", Storage::GetPartition(target_map, d1));
- hide = (size(Storage::GetPartition(target_map, d1))>0||
- Storage::IsPartType(target_map[d1,"type"]:`CT_UNKNOWN)) &&
- !partition["evms_native"]:false;
- }
- y2milestone( "evms d1:%1 hide:%2", d1, hide );
- }
+ if (disk["used_by_type"]:`UB_NONE == `UB_DMRAID)
+ return true;
- return hide;
+ return false;
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
Author: mvidner
Date: Wed Jul 30 15:33:10 2008
New Revision: 49527
URL: http://svn.opensuse.org/viewcvs/yast?rev=49527&view=rev
Log:
Created tag stable-2_17_7 for core
Added:
tags/stable-2_17_7/core/
- copied from r49526, trunk/core/
--
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] r49526 - in /trunk/pkg-bindings/src: Callbacks_Register.cc Package.cc Source_Load.cc
by mvidner@svn.opensuse.org 30 Jul '08
by mvidner@svn.opensuse.org 30 Jul '08
30 Jul '08
Author: mvidner
Date: Wed Jul 30 15:28:18 2008
New Revision: 49526
URL: http://svn.opensuse.org/viewcvs/yast?rev=49526&view=rev
Log:
Ensured the uniqueness of ids in documentation.
Modified:
trunk/pkg-bindings/src/Callbacks_Register.cc
trunk/pkg-bindings/src/Package.cc
trunk/pkg-bindings/src/Source_Load.cc
Modified: trunk/pkg-bindings/src/Callbacks_Register.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Callbacks_Regis…
==============================================================================
--- trunk/pkg-bindings/src/Callbacks_Register.cc (original)
+++ trunk/pkg-bindings/src/Callbacks_Register.cc Wed Jul 30 15:28:18 2008
@@ -547,7 +547,7 @@
}
/**
- * @builtin CallbackSourceProbeStart
+ * @builtin CallbackSourceReportStart
* @short Register callback function
* @param string args Name of the callback handler function. Required callback prototype is <code>void(integer source_id, string url, string task)</code>.
* @return void
Modified: trunk/pkg-bindings/src/Package.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Package.cc?rev=…
==============================================================================
--- trunk/pkg-bindings/src/Package.cc (original)
+++ trunk/pkg-bindings/src/Package.cc Wed Jul 30 15:28:18 2008
@@ -1892,7 +1892,7 @@
/**
- * @builtin Reset
+ * @builtin PkgReset
*
* @short Reset most internal stuff on the package manager.
@return boolean
@@ -1922,7 +1922,7 @@
/**
- * @builtin Reset
+ * @builtin PkgApplReset
*
* @short Reset most internal stuff on the package manager.
Reset only packages set by the application, not by the user
Modified: trunk/pkg-bindings/src/Source_Load.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Source_Load.cc?…
==============================================================================
--- trunk/pkg-bindings/src/Source_Load.cc (original)
+++ trunk/pkg-bindings/src/Source_Load.cc Wed Jul 30 15:28:18 2008
@@ -157,14 +157,6 @@
return YCPVoid();
}
-/****************************************************************************************
- * @builtin SourceLoad
- *
- * @short Load resolvables from the installation sources
- * @description
- * Refresh the pool - Add/remove resolvables from the enabled/disabled sources.
- * @return boolean True on success
- **/
YCPValue
PkgFunctions::SourceLoadImpl(PkgProgress &progress)
{
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
30 Jul '08
Author: mvidner
Date: Wed Jul 30 15:23:04 2008
New Revision: 49525
URL: http://svn.opensuse.org/viewcvs/yast?rev=49525&view=rev
Log:
Created tag stable-2_17_5 for devtools
Added:
tags/stable-2_17_5/devtools/
- copied from r49524, trunk/devtools/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0