YaST Commits
Threads by month
- ----- 2024 -----
- 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
November 2007
- 24 participants
- 864 discussions
Author: rpmcruz
Date: Mon Nov 12 20:27:04 2007
New Revision: 41986
URL: http://svn.opensuse.org/viewcvs/yast?rev=41986&view=rev
Log:
Mistake on ChangeLog.
Modified:
trunk/gtk/ChangeLog
Modified: trunk/gtk/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/ChangeLog?rev=41986&r1=41985…
==============================================================================
--- trunk/gtk/ChangeLog (original)
+++ trunk/gtk/ChangeLog Mon Nov 12 20:27:04 2007
@@ -1,12 +1,5 @@
2007-11-12 Ricardo Cruz <rpmcruz(a)alunos.dcc.fc.up.pt>
- * src/YGUtils.cc: added stock icon mapping for English locale.
- Soon yast-qt will get bug reports to implement the same thing, and
- they will push for the yast-ui guy a more universal way to allow for
- that.
-
-2007-11-12 Ricardo Cruz <rpmcruz(a)alunos.dcc.fc.up.pt>
-
* src/YGUI.cc: on PollInput, run g_main_iteration() while there are
events to process.
@@ -19,6 +12,11 @@
API changes though).
* tests/Beep.ycp: removed, now shipped as a yast-ui example.
+ * src/YGUtils.cc: added stock icon mapping for English locale.
+ Soon yast-qt will get bug reports to implement the same thing, and
+ they will push for the yast-ui guy a more universal way to allow for
+ that.
+
2007-11-11 Ricardo Cruz <rpmcruz(a)alunos.dcc.fc.up.pt>
* src/YGDialog.h/cc & YGPackageSelector.cc: bug fix #340555: package
--
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] r41985 - in /trunk/gtk: ChangeLog src/YGPushButton.cc src/YGUtils.cc src/YGUtils.h src/YGWizard.cc src/ygtkwizard.c
by rpmcruz@svn.opensuse.org 12 Nov '07
by rpmcruz@svn.opensuse.org 12 Nov '07
12 Nov '07
Author: rpmcruz
Date: Mon Nov 12 20:26:25 2007
New Revision: 41985
URL: http://svn.opensuse.org/viewcvs/yast?rev=41985&view=rev
Log:
* src/YGUtils.cc: added stock icon mapping for English locale.
Soon yast-qt will get bug reports to implement the same thing, and
they will push for the yast-ui guy a more universal way to allow for
that.
Modified:
trunk/gtk/ChangeLog
trunk/gtk/src/YGPushButton.cc
trunk/gtk/src/YGUtils.cc
trunk/gtk/src/YGUtils.h
trunk/gtk/src/YGWizard.cc
trunk/gtk/src/ygtkwizard.c
Modified: trunk/gtk/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/ChangeLog?rev=41985&r1=41984…
==============================================================================
--- trunk/gtk/ChangeLog (original)
+++ trunk/gtk/ChangeLog Mon Nov 12 20:26:25 2007
@@ -1,5 +1,12 @@
2007-11-12 Ricardo Cruz <rpmcruz(a)alunos.dcc.fc.up.pt>
+ * src/YGUtils.cc: added stock icon mapping for English locale.
+ Soon yast-qt will get bug reports to implement the same thing, and
+ they will push for the yast-ui guy a more universal way to allow for
+ that.
+
+2007-11-12 Ricardo Cruz <rpmcruz(a)alunos.dcc.fc.up.pt>
+
* src/YGUI.cc: on PollInput, run g_main_iteration() while there are
events to process.
Modified: trunk/gtk/src/YGPushButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGPushButton.cc?rev=4198…
==============================================================================
--- trunk/gtk/src/YGPushButton.cc (original)
+++ trunk/gtk/src/YGPushButton.cc Mon Nov 12 20:26:25 2007
@@ -35,9 +35,10 @@
// YPushButton
virtual void setLabel (const YCPString &label)
{
- IMPL;
+ IMPL
string str = YGUtils::mapKBAccel (label->value_cstr());
gtk_button_set_label (GTK_BUTTON (getWidget()), str.c_str());
+ YGUtils::setStockIcon (getWidget(), str);
YPushButton::setLabel (label);
}
@@ -53,6 +54,7 @@
if (pixbuf) {
GtkWidget *image = gtk_image_new_from_pixbuf (pixbuf);
gtk_button_set_image (GTK_BUTTON (getWidget()), image);
+ g_object_unref (G_OBJECT (pixbuf));
}
else
y2warning ("YGPushButton: Couldn't load icon image: %s.\n"
@@ -68,10 +70,10 @@
YGWIDGET_IMPL_COMMON
};
-
YWidget *
YGUI::createPushButton (YWidget *parent, YWidgetOpt &opt,
const YCPString &label)
{
return new YGPushButton (opt, YGWidget::get (parent), label);
}
+
Modified: trunk/gtk/src/YGUtils.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUtils.cc?rev=41985&r1=…
==============================================================================
--- trunk/gtk/src/YGUtils.cc (original)
+++ trunk/gtk/src/YGUtils.cc Mon Nov 12 20:26:25 2007
@@ -703,3 +703,68 @@
id = g_timeout_add_full (G_PRIORITY_DEFAULT, SCROLLING_STEP, scroll_timeout, data, g_free);
}
+struct StockMap { const char *ycp_label, *gtk_stock; };
+static const StockMap stockMap[] = {
+ // keep them sorted!
+ {"Abort", GTK_STOCK_CANCEL },
+ {"Accept", GTK_STOCK_APPLY },
+ {"Add", GTK_STOCK_ADD },
+ {"Back", GTK_STOCK_GO_BACK },
+ {"Cancel", GTK_STOCK_CANCEL },
+ {"Configure", GTK_STOCK_PREFERENCES },
+ {"Continue", GTK_STOCK_OK },
+ {"Delete", GTK_STOCK_DELETE },
+ {"Down", GTK_STOCK_GO_DOWN },
+ {"Edit", GTK_STOCK_EDIT },
+ {"Launch", GTK_STOCK_EXECUTE },
+ {"Next", GTK_STOCK_GO_FORWARD },
+ {"No", GTK_STOCK_NO },
+ {"OK", GTK_STOCK_OK },
+ {"Search", GTK_STOCK_FIND },
+ {"Up", GTK_STOCK_GO_UP },
+ {"Yes", GTK_STOCK_YES },
+};
+#define STOCKMAP_SIZE (sizeof (stockMap)/sizeof(StockMap))
+static int strcmp_cb (const void *a, const void *b)
+{ return strcmp ((char *) a, ((StockMap *) b)->ycp_label); }
+
+void YGUtils::setStockIcon (GtkWidget *button, std::string ycp_str)
+{
+ // is English the current locale?
+ static bool firstTime = true, isEnglish;
+ if (firstTime) {
+ char *lang = getenv ("LANG");
+ isEnglish = !lang || (!*lang) || !strcmp (lang, "C") ||
+ (lang[0] == 'e' && lang[1] == 'n') ||
+ !strcmp (lang, "POSIX");
+ firstTime = false;
+ }
+ if (!isEnglish)
+ return;
+
+ unsigned int i = 0;
+ while ((i = ycp_str.find ('_', i)) != string::npos)
+ ycp_str.erase (i, 1);
+
+ bool failed = true;
+ void *ptr;
+ ptr = bsearch (ycp_str.c_str(), stockMap, STOCKMAP_SIZE,
+ sizeof(stockMap[0]), strcmp_cb);
+ if (ptr) {
+ const char *stock = ((StockMap *) ptr)->gtk_stock;
+ GdkPixbuf *pixbuf;
+ pixbuf = gtk_widget_render_icon (button, stock,
+ GTK_ICON_SIZE_BUTTON, NULL);
+ if (pixbuf) {
+ GtkWidget *image = gtk_image_new_from_pixbuf (pixbuf);
+ gtk_button_set_image (GTK_BUTTON (button), image);
+ g_object_unref (G_OBJECT (pixbuf));
+ failed = false;
+ }
+ }
+ if (failed)
+ gtk_button_set_image (GTK_BUTTON (button), NULL);
+}
+void ygutils_setStockIcon (GtkWidget *button, const char *ycp_str)
+{ YGUtils::setStockIcon (button, ycp_str); }
+
Modified: trunk/gtk/src/YGUtils.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUtils.h?rev=41985&r1=4…
==============================================================================
--- trunk/gtk/src/YGUtils.h (original)
+++ trunk/gtk/src/YGUtils.h Mon Nov 12 20:26:25 2007
@@ -21,7 +21,7 @@
/* Filters characters that are not on the valids_chars array from the text string
Length is used to tell the length of text, in case it isn't NUL
terminated (you may pass -1, if it is).
- Use the compare string member if you won't to see if there was any change. */
+ Use the compare string member if you want to see if there was any change. */
string filterText (const char* text, int length, const char* valid_chars);
/* Convenience call for widgets that implement GtkEditable interface.
@@ -78,6 +78,8 @@
/* Converts stuff to GValues */
GValue floatToGValue (float num);
+
+ void setStockIcon (GtkWidget *button, std::string ycp_str);
};
extern "C" {
@@ -87,6 +89,7 @@
/* Convert html to xhtml (or at least try) */
gchar *ygutils_convert_to_xhmlt_and_subst (const char *instr, const char *product);
+ void ygutils_setStockIcon (GtkWidget *button, const char *ycp_str);
};
#endif // YGUTILS_H
Modified: trunk/gtk/src/YGWizard.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGWizard.cc?rev=41985&r1…
==============================================================================
--- trunk/gtk/src/YGWizard.cc (original)
+++ trunk/gtk/src/YGWizard.cc Mon Nov 12 20:26:25 2007
@@ -35,6 +35,7 @@
string str = YGUtils::mapKBAccel (label->value_cstr());
gtk_button_set_label (GTK_BUTTON (m_widget), str.c_str());
str.empty() ? gtk_widget_hide (m_widget) : gtk_widget_show (m_widget);
+ YGUtils::setStockIcon (m_widget, str);
YPushButton::setLabel (label);
}
Modified: trunk/gtk/src/ygtkwizard.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkwizard.c?rev=41985&r…
==============================================================================
--- trunk/gtk/src/ygtkwizard.c (original)
+++ trunk/gtk/src/ygtkwizard.c Mon Nov 12 20:26:25 2007
@@ -22,6 +22,7 @@
// YGUtils bridge
extern void ygutils_setWidgetFont (GtkWidget *widget, PangoWeight weight,
double scale);
+extern void ygutils_setStockIcon (GtkWidget *button, const char *ycp_str);
//** YGtkHelpDialog
@@ -607,18 +608,21 @@
{
gtk_button_set_label (GTK_BUTTON (wizard->m_abort_button), text);
ENABLE_WIDGET_STR (text, wizard->m_abort_button);
+ ygutils_setStockIcon (wizard->m_abort_button, text);
}
void ygtk_wizard_set_back_button_label (YGtkWizard *wizard, const char *text)
{
gtk_button_set_label (GTK_BUTTON (wizard->m_back_button), text);
ENABLE_WIDGET_STR (text, wizard->m_back_button);
+ ygutils_setStockIcon (wizard->m_back_button, text);
}
void ygtk_wizard_set_next_button_label (YGtkWizard *wizard, const char *text)
{
gtk_button_set_label (GTK_BUTTON (wizard->m_next_button), text);
ENABLE_WIDGET_STR (text, wizard->m_next_button);
+ ygutils_setStockIcon (wizard->m_next_button, text);
}
void ygtk_wizard_set_back_button_id (YGtkWizard *wizard, gpointer id,
--
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] r41984 - in /branches/tmp/sh/mod-ui: core/libyui/doc/ core/libyui/src/ qt/src/
by sh-sh-sh@svn.opensuse.org 12 Nov '07
by sh-sh-sh@svn.opensuse.org 12 Nov '07
12 Nov '07
Author: sh-sh-sh
Date: Mon Nov 12 17:35:40 2007
New Revision: 41984
URL: http://svn.opensuse.org/viewcvs/yast?rev=41984&view=rev
Log:
ported YDownloadProgress
Modified:
branches/tmp/sh/mod-ui/core/libyui/doc/YCPDialogParser.xml
branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog
branches/tmp/sh/mod-ui/core/libyui/src/UIBuiltinCalls.h
branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc
branches/tmp/sh/mod-ui/core/libyui/src/YDownloadProgress.cc
branches/tmp/sh/mod-ui/core/libyui/src/YDownloadProgress.h
branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.cc
branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.h
branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.h
branches/tmp/sh/mod-ui/core/libyui/src/YTypes.h
branches/tmp/sh/mod-ui/core/libyui/src/YUI.h
branches/tmp/sh/mod-ui/core/libyui/src/YUISymbols.h
branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc
branches/tmp/sh/mod-ui/core/libyui/src/YUI_special_widgets.cc
branches/tmp/sh/mod-ui/qt/src/YQDownloadProgress.cc
branches/tmp/sh/mod-ui/qt/src/YQDownloadProgress.h
branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.cc
branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.h
branches/tmp/sh/mod-ui/qt/src/YQUI.h
branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc
Modified: branches/tmp/sh/mod-ui/core/libyui/doc/YCPDialogParser.xml
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/doc…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/doc/YCPDialogParser.xml (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/YCPDialogParser.xml Mon Nov 12 17:35:40 2007
@@ -296,6 +296,25 @@
<variablelist>
<varlistentry>
<term>
+ <type>list<integer></type>
+ <parameter>Values</parameter>
+ </term>
+ <listitem>
+ <para>The numerical value for each segment.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>list<string></type>
+ <parameter>Labels</parameter>
+ </term>
+ <listitem>
+ <para>Text label for each segment ('\n' allowed).
+Use %1 as a placeholder for the current value.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
<type>integer-list</type>
<parameter>Values</parameter>
</term>
@@ -728,6 +747,15 @@
</varlistentry>
<varlistentry>
<term>
+ <type>itemList</type>
+ <parameter>Items</parameter>
+ </term>
+ <listitem>
+ <para>All items</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
<type>string</type>
<parameter>ValidChars</parameter>
</term>
@@ -744,6 +772,15 @@
<para>maximum number of input characters</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>IconPath</parameter>
+ </term>
+ <listitem>
+ <para>Base path for icons</para>
+ </listitem>
+ </varlistentry>
</variablelist>
</refsect1>
<refsect1>
@@ -797,13 +834,13 @@
</informalexample>
</refsect1>
</refentry>
- <refentry id="Date_widget">
+ <refentry id="DateField_widget">
<refmeta>
- <refentrytitle>Date</refentrytitle>
+ <refentrytitle>DateField</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
- <refname>Date</refname>
+ <refname>DateField</refname>
<refpurpose>Date input field</refpurpose>
</refnamediv>
<refsynopsisdiv>
@@ -811,12 +848,16 @@
<funcprototype>
<funcdef>
<type></type>
- <function>Date</function>
+ <function>DateField</function>
</funcdef>
<paramdef>
<type>string</type>
<parameter>label</parameter>
</paramdef>
+ <paramdef choice="opt">
+ <type>string</type>
+ <parameter>initialDate</parameter>
+ </paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
@@ -835,6 +876,20 @@
</variablelist>
</refsect1>
<refsect1>
+ <title>Optional Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>initialDate</parameter>
+ </term>
+ <listitem>
+ <para></para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
<title>Properties</title>
<variablelist>
<varlistentry>
@@ -843,7 +898,16 @@
<parameter>Value</parameter>
</term>
<listitem>
- <para>the date </para>
+ <para>the date (the field's contents) as "YYYY-MM-DD"</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Label</parameter>
+ </term>
+ <listitem>
+ <para>caption above the input field</para>
</listitem>
</varlistentry>
</variablelist>
@@ -851,13 +915,17 @@
<refsect1>
<title>Description</title>
<para>
- <para> A Date input widget for entering dates. This widget is available in the Qt interface only</para>
+ <para> An input field for entering a date.</para>
</para>
+ <note>
+ <para>This is a "special" widget, i.e. not all UIs necessarily support it. Check for availability with <replaceable>HasSpecialWidget( `TimeField)</replaceable> before using it.</para>
+ </note>
</refsect1>
<refsect1>
<title>Usage</title>
<programlisting>
- `Date( "Date:", "2004-10-12" )
+ if ( HasSpecialWidget( `DateField ) {...
+ `DateField( "Date:", "2004-10-12" )
</programlisting>
</refsect1>
</refentry>
@@ -2132,7 +2200,25 @@
<parameter>Value</parameter>
</term>
<listitem>
- <para>the numerical value</para>
+ <para>the field's contents (the user input)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>MinValue</parameter>
+ </term>
+ <listitem>
+ <para>the minimum value</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>MaxValue</parameter>
+ </term>
+ <listitem>
+ <para>the maximum value</para>
</listitem>
</varlistentry>
<varlistentry>
@@ -2141,7 +2227,7 @@
<parameter>Label</parameter>
</term>
<listitem>
- <para>the slider label</para>
+ <para>caption above the field</para>
</listitem>
</varlistentry>
</variablelist>
@@ -2603,8 +2689,7 @@
<parameter>Value</parameter>
</term>
<listitem>
- <para>All log lines. Set this property to replace or clear the entire contents.
-Can only be set, not queried.</para>
+ <para>All log lines.</para>
</listitem>
</varlistentry>
<varlistentry>
@@ -2613,8 +2698,25 @@
<parameter>LastLine</parameter>
</term>
<listitem>
- <para>The last log line. Set this property to append one or more line(s) to the log.
-Can only be set, not queried.</para>
+ <para>The last log line(s). Use this to append lines.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>VisibleLines</parameter>
+ </term>
+ <listitem>
+ <para>Number of lines to display. Call RecalcLayout() afterwards.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>MaxLines</parameter>
+ </term>
+ <listitem>
+ <para>Number of lines to store (0 for all).</para>
</listitem>
</varlistentry>
<varlistentry>
@@ -2623,7 +2725,7 @@
<parameter>Label</parameter>
</term>
<listitem>
- <para>The label above the log text.</para>
+ <para>Caption above the log text</para>
</listitem>
</varlistentry>
</variablelist>
@@ -2818,7 +2920,25 @@
<parameter>Label</parameter>
</term>
<listitem>
- <para>the text on the MenuButton</para>
+ <para>Label on the menu button</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>itemList</type>
+ <parameter>Items</parameter>
+ </term>
+ <listitem>
+ <para>All menu items and submenus</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>IconPath</parameter>
+ </term>
+ <listitem>
+ <para>Base path for icons (on menu items)</para>
</listitem>
</varlistentry>
</variablelist>
@@ -3564,11 +3684,11 @@
<variablelist>
<varlistentry>
<term>
- <type>integer</type>
+ <type>string</type>
<parameter>Value</parameter>
</term>
<listitem>
- <para>the numerical value</para>
+ <para>the value (the size of the new partition)</para>
</listitem>
</varlistentry>
</variablelist>
@@ -4482,7 +4602,16 @@
<parameter>Label</parameter>
</term>
<listitem>
- <para>caption above the selection box</para>
+ <para>Caption above the selection box</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>IconPath</parameter>
+ </term>
+ <listitem>
+ <para>Base path for icons</para>
</listitem>
</varlistentry>
</variablelist>
@@ -4676,7 +4805,25 @@
<parameter>Value</parameter>
</term>
<listitem>
- <para>the numerical value</para>
+ <para>the slider value</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>MinValue</parameter>
+ </term>
+ <listitem>
+ <para>the minimum value</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>integer</type>
+ <parameter>MaxValue</parameter>
+ </term>
+ <listitem>
+ <para>the maximum value</para>
</listitem>
</varlistentry>
<varlistentry>
@@ -4685,7 +4832,7 @@
<parameter>Label</parameter>
</term>
<listitem>
- <para>the slider label</para>
+ <para>caption above the slider</para>
</listitem>
</varlistentry>
</variablelist>
@@ -4816,39 +4963,83 @@
<variablelist>
<varlistentry>
<term>
- <type>integer</type>
+ <type>itemID</type>
+ <parameter>Value</parameter>
+ </term>
+ <listitem>
+ <para>The currently selected item</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>itemID</type>
<parameter>CurrentItem</parameter>
</term>
<listitem>
- <para>the ID of the currently selected item
-Alias: Value</para>
+ <para>The currently selected item</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
- <type>list(item)</type>
+ <type>itemList</type>
<parameter>Items</parameter>
</term>
<listitem>
- <para>a list of all table items</para>
+ <para>All items</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
- <type>item</type>
- <parameter>Item(id)</parameter>
+ <type>string</type>
+ <parameter>Cell</parameter>
</term>
<listitem>
- <para>read: a single item (string or term)</para>
+ <para>One cell (one column of one item)</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
- <type>integer|string</type>
- <parameter>Item(id,column)</parameter>
+ <type>integer</type>
+ <parameter>Cell</parameter>
+ </term>
+ <listitem>
+ <para>(ChangeWidget only) One cell as integer</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>`icon(...)</type>
+ <parameter>Cell</parameter>
</term>
<listitem>
- <para>write: replacement for one specific cell ( see example )</para>
+ <para>Icon for one one cell</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Item</parameter>
+ </term>
+ <listitem>
+ <para>Alias for Cell</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Item</parameter>
+ </term>
+ <listitem>
+ <para>QueryWidget only: Return one complete item</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>IconPath</parameter>
+ </term>
+ <listitem>
+ <para>Base path for icons</para>
</listitem>
</varlistentry>
</variablelist>
@@ -4856,10 +5047,46 @@
<refsect1>
<title>Description</title>
<para>
- <para> A Table widget is a generalization of the SelectionBox. Information is displayed in a number of columns. Each column has a header. The number of columns and their titles are described by the first argument, which is a term with the symbol <replaceable>header</replaceable>. For each column you add a string specifying its title. For example <replaceable>`header( "Name", "Price" )</replaceable> creates the two columns "Name" and "Price".</para>
+ <para> The Table widget is a selection list with multiple columns. The user can select exactly one row (with all its columns) from that list.</para>
+ </para>
+ <para>
+ <para> Each cell (each column within each row) has a label text and an optional icon.</para>
+ </para>
+ <para>
+ <para> (Note: Not all UIs (in particular not text-based UIs) support displaying icons, so an icon should never be an exclusive means to display any kind of information).</para>
+ </para>
+ <para>
+ <para> This widget is similar to SelectionBox, but it has several columns for each item (each row). If just one column is desired, consider using SelectionBox instead.</para>
+ </para>
+ <para>
+ <para> Note: This is not something like a spread sheet, and it doesn't pretend or want to be. Actions are performed on rows, not on individual cells (columns within one row).</para>
+ </para>
+ <para>
+ <para> The first argument (after `opt() and `id() which both are optional) is `header() which specifies the column headers (and implicitly the number of columns) and optionally the alignment for each column. Default alignment is left.</para>
+ </para>
+ <para>
+ <para> In the list of items, an ID is specified for each item. Each item can have less cells (columns) than the table has columns (from `header()), in which case any missing cells are assumed to be empty. If an item has more cells than the table has columns, any extra cells are ignored.</para>
+ </para>
+ <para>
+ <para> Each cell has a text label (which might also be an empty string) and optionally an icon. If a cell has an icon, it has to be specified with `cell(`icon("myiconname.png", "Label text")).</para>
+ </para>
+ <para>
+ <para> A simple table is specified like this:</para>
+ </para>
+ <para>
+ <para> `Table(`id(`players), `header("Nick", "Age", "Role"), [ `item(`id("Bluebird"), "Bluebird, 18, "Scout" ), `item(`id("Ozzz" ), "Ozzz", 23, "Wizard" ), `item(`id("Wannabe" ), "Wannabe", 17 ), `item(`id("Coxxan" ), "Coxxan", 26, "Warrior") ] )</para>
+ </para>
+ <para>
+ <para> This will create a 3-column table. The first column ("Nick") and the third column ("Role") will be left aligned. The second column ("Age") will be right aligned. note that "Wannabe" doesn't have a Role. This field will be empty.</para>
+ </para>
+ <para>
+ <para> A table that uses icons is specified like this:</para>
+ </para>
+ <para>
+ <para> `Table(`id(`players), `header("Nick", "Age", "Role"), [ `item(`id("Bluebird"), "Bluebird, 18, `cell(`icon("scout.png"), "Scout" ) ), `item(`id("Ozzz" ), "Ozzz", 23, "Wizard" ), `item(`id("Wannabe" ), "Wannabe", `cell(`icon("underage.png", 17 ) ), `item(`id("Coxxan" ), "Coxxan", `cell(`icon("oldman.png", 26 ), "Warrior" ) ] )</para>
</para>
<para>
- <para> The second argument is an optional list of items (rows) that are inserted in the table. Each item has the form <replaceable>`item( `id( </replaceable> id <replaceable> ), first column, second column, ... )</replaceable>. For each column one argument has to be specified, which must be of type void, string or integer. Strings are being left justified, integer right and a nil denote an empty cell, just as the empty string.</para>
+ <para> In this example, "Bluebird" has an additional icon in his "Role" column, and "Wannabe" and "Coxxan" both have additional icons in their "Age" columns.</para>
</para>
</refsect1>
<refsect1>
@@ -4916,13 +5143,13 @@
</informalexample>
</refsect1>
</refentry>
- <refentry id="Time_widget">
+ <refentry id="TimeField_widget">
<refmeta>
- <refentrytitle>Time</refentrytitle>
+ <refentrytitle>TimeField</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
- <refname>Time</refname>
+ <refname>TimeField</refname>
<refpurpose>Time input field</refpurpose>
</refnamediv>
<refsynopsisdiv>
@@ -4930,12 +5157,16 @@
<funcprototype>
<funcdef>
<type></type>
- <function>Time</function>
+ <function>TimeField</function>
</funcdef>
<paramdef>
<type>string</type>
<parameter>label</parameter>
</paramdef>
+ <paramdef choice="opt">
+ <type>string</type>
+ <parameter>initialTime</parameter>
+ </paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
@@ -4954,6 +5185,20 @@
</variablelist>
</refsect1>
<refsect1>
+ <title>Optional Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>initialTime</parameter>
+ </term>
+ <listitem>
+ <para></para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
<title>Properties</title>
<variablelist>
<varlistentry>
@@ -4962,7 +5207,16 @@
<parameter>Value</parameter>
</term>
<listitem>
- <para>the date </para>
+ <para>the time (the field's contents) as "hh:mm:ss"</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <type>string</type>
+ <parameter>Label</parameter>
+ </term>
+ <listitem>
+ <para>caption above the input field</para>
</listitem>
</varlistentry>
</variablelist>
@@ -4970,13 +5224,17 @@
<refsect1>
<title>Description</title>
<para>
- <para> A Time input widget for entering time. This widget is available in the Qt interface only</para>
+ <para> An input field for entering a time of day in 24 hour format.</para>
</para>
+ <note>
+ <para>This is a "special" widget, i.e. not all UIs necessarily support it. Check for availability with <replaceable>HasSpecialWidget( `TimeField)</replaceable> before using it.</para>
+ </note>
</refsect1>
<refsect1>
<title>Usage</title>
<programlisting>
- `Time( "Time:" , "20:20:20" )
+ if ( HasSpecialWidget( `TimeField ) {...
+ `TimeField( "Time:" , "20:20:20" )
</programlisting>
</refsect1>
</refentry>
@@ -5107,58 +5365,16 @@
<parameter>Label</parameter>
</term>
<listitem>
- <para>caption above the tree</para>
+ <para>Caption above the tree</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<type>string</type>
- <parameter>Label</parameter>
- </term>
- <listitem>
- <para>the label above the Tree</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <type>itemId</type>
- <parameter>CurrentItem</parameter>
- </term>
- <listitem>
- <para>the currently selected item
-Alias: Value</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <type>YTreeItem</type>
- <parameter>list</parameter>
- </term>
- <listitem>
- <para>Items
-The items that are displayed</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <type>OpenItems</type>
- <parameter>a</parameter>
+ <parameter>IconPath</parameter>
</term>
<listitem>
- <para>map of open items - can only be queried, not set</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <type>CurrentBranch</type>
- <parameter>a</parameter>
- </term>
- <listitem>
- <para>list of the current item and all its ancestors
-from the root item to the current item- either the respective IDs or,
-for items that don't have IDs, the item text. If no item is currently
-selected, 'nil' is returned.
-This property can only be queried, not set.</para>
+ <para>Base path for icons</para>
</listitem>
</varlistentry>
</variablelist>
@@ -5462,7 +5678,7 @@
<para> A wizard widget always has ID `wizard.<p> The ID of the single replace point within the wizard is always `contents.</para>
</para>
<note>
- <para>This is a "special" widget, i.e. not all UIs necessarily support it. Check for availability with <replaceable>HasSpecialWidget( `PartitionSplitter )</replaceable> before using it.</para>
+ <para>This is a "special" widget, i.e. not all UIs necessarily support it. Check for availability with <replaceable>HasSpecialWidget( `Wizard)</replaceable> before using it.</para>
</note>
</refsect1>
<refsect1>
Modified: branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog Mon Nov 12 17:35:40 2007
@@ -419,3 +419,9 @@
* Ported YBarGraph
* Ported YPartitionSplitter
+
+2007-11-12 sh(a)suse.de
+
+* Enforced creating YWidget and derived classes with new (on the heap)
+* Ported YDownloadProgress
+
Modified: branches/tmp/sh/mod-ui/core/libyui/src/UIBuiltinCalls.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/UIBuiltinCalls.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/UIBuiltinCalls.h Mon Nov 12 17:35:40 2007
@@ -1,31 +1,30 @@
// This file is generated by generateYCPwrappers from Y2UINamespace.h
- static const char * err_fmt = "Parameter %d is nil, %s is required";
case 0: // SetLanguage
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "String"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "String"); return YCPVoid();}
return m_instance->SetLanguage (m_param1->asString());
case 1: // SetLanguage
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "String"); return YCPVoid();}
- if (m_param2->isVoid()) {ycp2error(err_fmt, 2, "String"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "String"); return YCPVoid();}
+ if (m_param2->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 2, "String"); return YCPVoid();}
return m_instance->SetLanguage (m_param1->asString(), m_param2->asString());
case 2: // GetProductName
return m_instance->GetProductName ();
case 3: // SetProductName
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "String"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "String"); return YCPVoid();}
return m_instance->SetProductName (m_param1->asString());
case 4: // SetConsoleFont
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "String"); return YCPVoid();}
- if (m_param2->isVoid()) {ycp2error(err_fmt, 2, "String"); return YCPVoid();}
- if (m_param3->isVoid()) {ycp2error(err_fmt, 3, "String"); return YCPVoid();}
- if (m_param4->isVoid()) {ycp2error(err_fmt, 4, "String"); return YCPVoid();}
- if (m_param5->isVoid()) {ycp2error(err_fmt, 5, "String"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "String"); return YCPVoid();}
+ if (m_param2->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 2, "String"); return YCPVoid();}
+ if (m_param3->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 3, "String"); return YCPVoid();}
+ if (m_param4->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 4, "String"); return YCPVoid();}
+ if (m_param5->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 5, "String"); return YCPVoid();}
return m_instance->SetConsoleFont (m_param1->asString(), m_param2->asString(), m_param3->asString(), m_param4->asString(), m_param5->asString());
case 5: // SetKeyboard
return m_instance->SetKeyboard ();
case 6: // GetLanguage
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Boolean"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Boolean"); return YCPVoid();}
return m_instance->GetLanguage (m_param1->asBoolean());
case 7: // UserInput
@@ -34,71 +33,71 @@
return m_instance->PollInput ();
case 9: // TimeoutUserInput
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Integer"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Integer"); return YCPVoid();}
return m_instance->TimeoutUserInput (m_param1->asInteger());
case 10: // WaitForEvent
return m_instance->WaitForEvent ();
case 11: // WaitForEvent
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Integer"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Integer"); return YCPVoid();}
return m_instance->WaitForEvent (m_param1->asInteger());
case 12: // OpenDialog
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Term"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Term"); return YCPVoid();}
return m_instance->OpenDialog (m_param1->asTerm());
case 13: // OpenDialog
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Term"); return YCPVoid();}
- if (m_param2->isVoid()) {ycp2error(err_fmt, 2, "Term"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Term"); return YCPVoid();}
+ if (m_param2->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 2, "Term"); return YCPVoid();}
return m_instance->OpenDialog (m_param1->asTerm(), m_param2->asTerm());
case 14: // CloseDialog
return m_instance->CloseDialog ();
case 15: // ChangeWidget
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Symbol"); return YCPVoid();}
- if (m_param2->isVoid()) {ycp2error(err_fmt, 2, "Symbol"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Symbol"); return YCPVoid();}
+ if (m_param2->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 2, "Symbol"); return YCPVoid();}
// m_param3 may be nil
return m_instance->ChangeWidget (m_param1->asSymbol(), m_param2->asSymbol(), m_param3->asValue());
case 16: // ChangeWidget
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Term"); return YCPVoid();}
- if (m_param2->isVoid()) {ycp2error(err_fmt, 2, "Symbol"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Term"); return YCPVoid();}
+ if (m_param2->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 2, "Symbol"); return YCPVoid();}
// m_param3 may be nil
return m_instance->ChangeWidget (m_param1->asTerm(), m_param2->asSymbol(), m_param3->asValue());
case 17: // ChangeWidget
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Term"); return YCPVoid();}
- if (m_param2->isVoid()) {ycp2error(err_fmt, 2, "Term"); return YCPVoid();}
- if (m_param3->isVoid()) {ycp2error(err_fmt, 3, "Value"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Term"); return YCPVoid();}
+ if (m_param2->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 2, "Term"); return YCPVoid();}
+ if (m_param3->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 3, "Value"); return YCPVoid();}
return m_instance->ChangeWidget (m_param1->asTerm(), m_param2->asTerm(), m_param3->asValue());
case 18: // QueryWidget
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Symbol"); return YCPVoid();}
- if (m_param2->isVoid()) {ycp2error(err_fmt, 2, "Symbol"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Symbol"); return YCPVoid();}
+ if (m_param2->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 2, "Symbol"); return YCPVoid();}
return m_instance->QueryWidget (m_param1->asSymbol(), m_param2->asSymbol());
case 19: // QueryWidget
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Symbol"); return YCPVoid();}
- if (m_param2->isVoid()) {ycp2error(err_fmt, 2, "Term"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Symbol"); return YCPVoid();}
+ if (m_param2->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 2, "Term"); return YCPVoid();}
return m_instance->QueryWidget (m_param1->asSymbol(), m_param2->asTerm());
case 20: // QueryWidget
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Term"); return YCPVoid();}
- if (m_param2->isVoid()) {ycp2error(err_fmt, 2, "Symbol"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Term"); return YCPVoid();}
+ if (m_param2->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 2, "Symbol"); return YCPVoid();}
return m_instance->QueryWidget (m_param1->asTerm(), m_param2->asSymbol());
case 21: // QueryWidget
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Term"); return YCPVoid();}
- if (m_param2->isVoid()) {ycp2error(err_fmt, 2, "Term"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Term"); return YCPVoid();}
+ if (m_param2->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 2, "Term"); return YCPVoid();}
return m_instance->QueryWidget (m_param1->asTerm(), m_param2->asTerm());
case 22: // ReplaceWidget
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Symbol"); return YCPVoid();}
- if (m_param2->isVoid()) {ycp2error(err_fmt, 2, "Term"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Symbol"); return YCPVoid();}
+ if (m_param2->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 2, "Term"); return YCPVoid();}
return m_instance->ReplaceWidget (m_param1->asSymbol(), m_param2->asTerm());
case 23: // ReplaceWidget
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Term"); return YCPVoid();}
- if (m_param2->isVoid()) {ycp2error(err_fmt, 2, "Term"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Term"); return YCPVoid();}
+ if (m_param2->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 2, "Term"); return YCPVoid();}
return m_instance->ReplaceWidget (m_param1->asTerm(), m_param2->asTerm());
case 24: // SetFocus
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Symbol"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Symbol"); return YCPVoid();}
return m_instance->SetFocus (m_param1->asSymbol());
case 25: // SetFocus
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Term"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Term"); return YCPVoid();}
return m_instance->SetFocus (m_param1->asTerm());
case 26: // RunInTerminal
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "String"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "String"); return YCPVoid();}
return m_instance->RunInTerminal (m_param1->asString());
case 27: // BusyCursor
@@ -110,7 +109,7 @@
return m_instance->NormalCursor ();
case 30: // MakeScreenShot
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "String"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "String"); return YCPVoid();}
return m_instance->MakeScreenShot (m_param1->asString());
case 31: // MakeScreenShot
@@ -122,22 +121,22 @@
return m_instance->Beep ();
case 34: // RecordMacro
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "String"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "String"); return YCPVoid();}
return m_instance->RecordMacro (m_param1->asString());
case 35: // StopRecordMacro
return m_instance->StopRecordMacro ();
case 36: // PlayMacro
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "String"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "String"); return YCPVoid();}
return m_instance->PlayMacro (m_param1->asString());
case 37: // FakeUserInput
return m_instance->FakeUserInput ();
case 38: // FakeUserInput
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Value"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Value"); return YCPVoid();}
return m_instance->FakeUserInput (m_param1->asValue());
case 39: // Glyph
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Symbol"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Symbol"); return YCPVoid();}
return m_instance->Glyph (m_param1->asSymbol());
case 40: // GetDisplayInfo
@@ -152,42 +151,42 @@
return m_instance->CheckShortcuts ();
case 44: // WidgetExists
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Symbol"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Symbol"); return YCPVoid();}
return m_instance->WidgetExists (m_param1->asSymbol());
case 45: // WidgetExists
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Term"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Term"); return YCPVoid();}
return m_instance->WidgetExists (m_param1->asTerm());
case 46: // RunPkgSelection
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Value"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Value"); return YCPVoid();}
return m_instance->RunPkgSelection (m_param1->asValue());
case 47: // AskForExistingDirectory
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "String"); return YCPVoid();}
- if (m_param2->isVoid()) {ycp2error(err_fmt, 2, "String"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "String"); return YCPVoid();}
+ if (m_param2->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 2, "String"); return YCPVoid();}
return m_instance->AskForExistingDirectory (m_param1->asString(), m_param2->asString());
case 48: // AskForExistingFile
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "String"); return YCPVoid();}
- if (m_param2->isVoid()) {ycp2error(err_fmt, 2, "String"); return YCPVoid();}
- if (m_param3->isVoid()) {ycp2error(err_fmt, 3, "String"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "String"); return YCPVoid();}
+ if (m_param2->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 2, "String"); return YCPVoid();}
+ if (m_param3->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 3, "String"); return YCPVoid();}
return m_instance->AskForExistingFile (m_param1->asString(), m_param2->asString(), m_param3->asString());
case 49: // AskForSaveFileName
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "String"); return YCPVoid();}
- if (m_param2->isVoid()) {ycp2error(err_fmt, 2, "String"); return YCPVoid();}
- if (m_param3->isVoid()) {ycp2error(err_fmt, 3, "String"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "String"); return YCPVoid();}
+ if (m_param2->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 2, "String"); return YCPVoid();}
+ if (m_param3->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 3, "String"); return YCPVoid();}
return m_instance->AskForSaveFileName (m_param1->asString(), m_param2->asString(), m_param3->asString());
case 50: // SetFunctionKeys
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Map"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Map"); return YCPVoid();}
return m_instance->SetFunctionKeys (m_param1->asMap());
case 51: // Recode
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "String"); return YCPVoid();}
- if (m_param2->isVoid()) {ycp2error(err_fmt, 2, "String"); return YCPVoid();}
- if (m_param3->isVoid()) {ycp2error(err_fmt, 3, "String"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "String"); return YCPVoid();}
+ if (m_param2->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 2, "String"); return YCPVoid();}
+ if (m_param3->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 3, "String"); return YCPVoid();}
return m_instance->Recode (m_param1->asString(), m_param2->asString(), m_param3->asString());
case 52: // SetModulename
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "String"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "String"); return YCPVoid();}
return m_instance->SetModulename (m_param1->asString());
case 53: // HasSpecialWidget
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Symbol"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Symbol"); return YCPVoid();}
return m_instance->HasSpecialWidget (m_param1->asSymbol());
case 54: // WizardCommand
- if (m_param1->isVoid()) {ycp2error(err_fmt, 1, "Term"); return YCPVoid();}
+ if (m_param1->isVoid()) {ycp2error("Parameter %d is nil, %s is required", 1, "Term"); return YCPVoid();}
return m_instance->WizardCommand (m_param1->asTerm());
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc Mon Nov 12 17:35:40 2007
@@ -49,6 +49,7 @@
#include "YCheckBoxFrame.h"
#include "YComboBox.h"
#include "YDateField.h"
+#include "YDownloadProgress.h"
#include "YDumbTab.h"
#include "YEmpty.h"
#include "YFrame.h"
@@ -2621,10 +2622,6 @@
* automatically updates the display as required even if the download is taking
* place in the foreground.
*
- * Please notice that this will work only if the UI runs on the same machine as
- * the file to download which may not taken for granted (but which is so for
- * most users).
- *
* @note This is a "special" widget, i.e. not all UIs necessarily support it. Check
* for availability with <tt>HasSpecialWidget( `DownloadProgress )</tt> before using it.
*
@@ -2648,23 +2645,12 @@
}
rejectAllOptions( term,optList );
- YWidget *downloadProgress;
-
- if ( YUI::ui()->hasDownloadProgress() )
- {
- YCPString label = term->value( argnr )->asString();
- YCPString filename = term->value( argnr+1 )->asString();
- int expectedSize = term->value( argnr+2 )->asInteger()->value();
- downloadProgress = YUI::ui()->createDownloadProgress( parent, opt, label, filename, expectedSize );
- }
- else
- {
- y2error( "This UI does not support the DownloadProgress widget." );
- return 0;
- }
+ string label = term->value( argnr )->asString()->value();
+ string filename = term->value( argnr+1 )->asString()->value();
+ YFileSize_t expectedSize = term->value( argnr+2 )->asInteger()->value();
- return downloadProgress;
+ return YUI::optionalWidgetFactory()->createDownloadProgress( parent, label, filename, expectedSize );
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YDownloadProgress.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YDownloadProgress.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YDownloadProgress.cc Mon Nov 12 17:35:40 2007
@@ -27,135 +27,167 @@
#include "YDownloadProgress.h"
-YDownloadProgress::YDownloadProgress( const YWidgetOpt & opt,
- const YCPString & label,
- const YCPString & filename,
- int expectedSize )
- : YWidget( opt )
- , _label( label )
- , _filename( filename )
- , _expectedSize( expectedSize )
+
+struct YDownloadProgressPrivate
+{
+ YDownloadProgressPrivate( const string & label,
+ const string & filename,
+ YFileSize_t expectedSize )
+ : label( label )
+ , filename( filename )
+ , expectedSize( expectedSize )
+ {}
+
+ string label;
+ string filename;
+ YFileSize_t expectedSize;
+};
+
+
+YDownloadProgress::YDownloadProgress( YWidget * parent,
+ const string & label,
+ const string & filename,
+ YFileSize_t expectedSize )
+ : YWidget( parent )
+ , priv( new YDownloadProgressPrivate( label, filename, expectedSize ) )
{
+ YUI_CHECK_NEW( priv );
+
setDefaultStretchable( YD_HORIZ, true );
setStretchable( YD_VERT, false );
}
-void YDownloadProgress::setLabel( const YCPString & newLabel )
+YDownloadProgress::~YDownloadProgress()
{
- _label = newLabel;
+ // NOP
}
-void YDownloadProgress::setFilename( const YCPString & newFilename )
+string
+YDownloadProgress::label() const
{
- _filename = newFilename;
+ return priv->label;
}
-void YDownloadProgress::setExpectedSize( int newExpectedSize )
+void
+YDownloadProgress::setLabel( const string & label )
{
- _expectedSize = newExpectedSize;
+ priv->label = label;
}
-YCPValue YDownloadProgress::changeWidget( const YCPSymbol & property,
- const YCPValue & newValue )
+string
+YDownloadProgress::filename() const
{
- string sym = property->symbol();
+ return priv->filename;
+}
- /**
- * @property string Label the label above the progress indicator
- */
- if ( sym == YUIProperty_Label )
- {
- if ( newValue->isString() )
- {
- setLabel( newValue->asString() );
- return YCPBoolean( true );
- }
- else
- {
- y2error( "YDownloadProgress::changeWidget( `Value ): "
- "Error: Expecting string, not %s",
- newValue->toString().c_str() );
- return YCPBoolean( false );
- }
- }
- /**
- * @property string Filename file name with full path of the file to poll
- */
- else if ( sym == YUIProperty_Filename )
- {
- if ( newValue->isString() )
- {
- setFilename( newValue->asString() );
- return YCPBoolean( true );
- }
- else
- {
- y2error( "YDownloadProgress::changeWidget( `Filename ): "
- "Error: Expecting string, not %s",
- newValue->toString().c_str() );
+void
+YDownloadProgress::setFilename( const string & filename )
+{
+ priv->filename = filename;
+}
- return YCPBoolean( false );
- }
- }
- /**
- * @property integer ExpectedSize expected final size of the file in bytes
- */
- else if ( sym == YUIProperty_ExpectedSize )
- {
- if ( newValue->isInteger() )
- {
- int val = newValue->asInteger()->value();
-
- if ( val < 1 )
- {
- y2warning( "YDownloadProgress::changeWidget( `expectedSize ): "
- "Warning: New value %d below minValue ( %d )",
- val, 0 );
- setExpectedSize(0);
- }
- else
- {
- setExpectedSize( val );
- }
-
- return YCPBoolean( true );
- }
- else
- {
- y2error( "YDownloadProgress::changeWidget( `expectedSize ): "
- "Error: Expecting integer value, not %s",
- newValue->toString().c_str() );
- return YCPBoolean( false );
- }
- }
- else return YWidget::changeWidget( property, newValue );
+YFileSize_t
+YDownloadProgress::expectedSize() const
+{
+ return priv->expectedSize;
}
+void
+YDownloadProgress::setExpectedSize( YFileSize_t newSize )
+{
+ priv->expectedSize = newSize;
+}
-YCPValue YDownloadProgress::queryWidget( const YCPSymbol & property )
+
+int
+YDownloadProgress::currentPercent() const
{
- string s = property->symbol();
- if ( s == YUIProperty_ExpectedSize ) return YCPInteger( expectedSize() );
- else if ( s == YUIProperty_Label ) return label();
- else if ( s == YUIProperty_Filename ) return filename();
- else return YWidget::queryWidget( property );
+ if ( priv->expectedSize == 0 ) // Avoid division by zero
+ return 0;
+
+ YFileSize_t currentSize = currentFileSize();
+
+ if ( currentSize >= priv->expectedSize )
+ return 100;
+ else
+ return (int) ( (100 * currentSize ) / priv->expectedSize );
}
-long YDownloadProgress::currentFileSize()
+YFileSize_t
+YDownloadProgress::currentFileSize() const
{
struct stat stat_info;
- if ( stat( filename()->value().c_str(), & stat_info ) == 0 )
- return (long) stat_info.st_size;
+ if ( stat( priv->filename.c_str(), & stat_info ) == 0 )
+ return (YFileSize_t) stat_info.st_size;
+ else
+ return 0;
+}
+
+
+const YPropertySet &
+YDownloadProgress::propertySet()
+{
+ static YPropertySet propSet;
+
+ if ( propSet.isEmpty() )
+ {
+ /*
+ * @property string Label text above the progress bar
+ * @property string Filename name of the file that is monitored
+ * @property integer ExpectedSize expected size of the file in bytes
+ * @property integer CurrentSize current size of the file in bytes (read-only!)
+ * @property integer Value current percent of the download (read-only!)
+ */
+ propSet.add( YProperty( YUIProperty_Label, YStringProperty ) );
+ propSet.add( YProperty( YUIProperty_Filename, YStringProperty ) );
+ propSet.add( YProperty( YUIProperty_ExpectedSize, YIntegerProperty ) );
+ propSet.add( YProperty( YUIProperty_CurrentSize, YIntegerProperty, true ) ); // read-only
+ propSet.add( YProperty( YUIProperty_Value, YIntegerProperty, true ) ); // read-only
+ propSet.add( YWidget::propertySet() );
+ }
+
+ return propSet;
+}
+
+
+bool
+YDownloadProgress::setProperty( const string & propertyName, const YPropertyValue & val )
+{
+ propertySet().check( propertyName, val.type() ); // throws exceptions if not found or type mismatch
+
+ if ( propertyName == YUIProperty_Label ) setLabel ( val.stringVal() );
+ if ( propertyName == YUIProperty_Filename ) setFilename ( val.stringVal() );
+ if ( propertyName == YUIProperty_ExpectedSize ) setExpectedSize( val.integerVal() );
else
- return 0L;
+ {
+ YWidget::setProperty( propertyName, val );
+ }
+
+ return true; // success -- no special handling necessary
}
+
+YPropertyValue
+YDownloadProgress::getProperty( const string & propertyName )
+{
+ propertySet().check( propertyName ); // throws exceptions if not found
+
+ if ( propertyName == YUIProperty_Label ) return YPropertyValue( label() );
+ if ( propertyName == YUIProperty_Filename ) return YPropertyValue( filename() );
+ if ( propertyName == YUIProperty_ExpectedSize ) return YPropertyValue( expectedSize() );
+ if ( propertyName == YUIProperty_CurrentSize ) return YPropertyValue( currentFileSize());
+ if ( propertyName == YUIProperty_Value ) return YPropertyValue( currentPercent() );
+ else
+ {
+ return YWidget::getProperty( propertyName );
+ }
+}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YDownloadProgress.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YDownloadProgress.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YDownloadProgress.h Mon Nov 12 17:35:40 2007
@@ -20,81 +20,133 @@
#define YDownloadProgress_h
#include "YWidget.h"
-#include <ycp/YCPString.h>
-#include <ycp/YCPInteger.h>
+class YDownloadProgressPrivate;
+
+/**
+ * DownloadProgress: A progress bar that monitors downloading a file by
+ * repeatedly polling its size up to its expected size.
+ **/
class YDownloadProgress : public YWidget
{
protected:
/**
- * Constructor
+ * Constructor.
+ *
+ * 'label' is the label above the progress bar.
+ *
+ * 'filename' is the name (with path) of the file being monitored.
+ *
+ * 'expectedSize' is the expected size of the file in bytes.
**/
- YDownloadProgress( const YWidgetOpt & opt,
- const YCPString & label,
- const YCPString & filename,
- int expectedSize );
-
+ YDownloadProgress( YWidget * parent,
+ const string & label,
+ const string & filename,
+ YFileSize_t expectedSize );
public:
/**
+ * Destructor.
+ **/
+ virtual ~YDownloadProgress();
+
+ /**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
**/
virtual const char * widgetClass() const { return "YDownloadProgress"; }
/**
- * Implements the ChangeWidget() UI command.
+ * Get the label (the text above the progress bar).
**/
- YCPValue changeWidget( const YCPSymbol & property,
- const YCPValue & newValue );
+ string label() const;
/**
- * Implements the QueryWidget() UI command.
+ * Set the label (the text above the progress bar).
+ *
+ * Derived classes are free to reimplement this, but they should call this
+ * base class method at the end of the overloaded function.
**/
- YCPValue queryWidget( const YCPSymbol & property );
+ virtual void setLabel( const string & label );
/**
- * Change the label above the progress indicator.
+ * Return the name of the file that is being monitored.
+ **/
+ string filename() const;
+
+ /**
+ * Set the name of a new file to monitor.
*
- * Overwrite this, but call YDownloadProgress::setLabel
- * at the end of your own method.
+ * Derived classes are free to reimplement this, but they should call this
+ * base class method at the end of the overloaded function.
+ **/
+ virtual void setFilename( const string & filename );
+
+ /**
+ * Return the expected file size.
**/
- virtual void setLabel( const YCPString & label );
+ YFileSize_t expectedSize() const;
/**
- * Change the filename.
+ * Set the expected file size.
*
- * Overwrite this, but call YDownloadProgress::setFilename()
- * at the end of your own method.
+ * Derived classes are free to reimplement this, but they should call this
+ * base class method at the end of the overloaded function.
**/
- virtual void setFilename( const YCPString & newFilename );
+ virtual void setExpectedSize( YFileSize_t newSize );
/**
- * Change the expected size of the file being downloaded.
+ * Return the current size of the file that is being downloaded
+ * or 0 if this file doesn't exist (yet).
*
- * Overwrite this, but call YDownloadProgress::setExpectedSize()
- * at the end of your own method.
+ * This default implementation returns the 'st_size' field of a stat()
+ * system call on the file. This should be useful for most implementations.
**/
- virtual void setExpectedSize( int newExpectedSize );
+ virtual YFileSize_t currentFileSize() const;
+ /**
+ * Return the percentage (0..100) of the file being downloaded so far.
+ **/
+ int currentPercent() const;
- YCPString label() { return _label; }
- YCPString filename() { return _filename; }
- int expectedSize() { return _expectedSize; }
+ /**
+ * Alias for currentPercent().
+ **/
+ int value() const { return currentPercent(); }
+
+ /**
+ * Set a property.
+ * Reimplemented from YWidget.
+ *
+ * This function may throw YUIPropertyExceptions.
+ *
+ * This function returns 'true' if the value was successfully set and
+ * 'false' if that value requires special handling (not in error cases:
+ * those are covered by exceptions).
+ **/
+ virtual bool setProperty( const string & propertyName,
+ const YPropertyValue & val );
+ /**
+ * Get a property.
+ * Reimplemented from YWidget.
+ *
+ * This method may throw YUIPropertyExceptions.
+ **/
+ virtual YPropertyValue getProperty( const string & propertyName );
/**
- * Returns the current size of the file that is being downloaded.
- * Returns 0 if this file doesn't exist ( yet ).
+ * Return this class's property set.
+ * This also initializes the property upon the first call.
+ *
+ * Reimplemented from YWidget.
**/
- long currentFileSize();
+ virtual const YPropertySet & propertySet();
private:
- YCPString _label;
- YCPString _filename;
- int _expectedSize;
+ ImplPtr<YDownloadProgressPrivate> priv;
};
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.cc Mon Nov 12 17:35:40 2007
@@ -225,7 +225,7 @@
YOptionalWidgetFactory::createDownloadProgress( YWidget * parent,
const string & label,
const string & filename,
- long expectedFileSize )
+ YFileSize_t expectedFileSize )
{
THROW_UNSUPPORTED( "YDownloadProgress" );
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.h Mon Nov 12 17:35:40 2007
@@ -116,7 +116,7 @@
virtual YDownloadProgress * createDownloadProgress ( YWidget * parent,
const string & label,
const string & filename,
- long expectedFileSize );
+ YFileSize_t expectedFileSize );
bool hasDummySpecialWidget();
YWidget * createDummySpecialWidget( YWidget * parent );
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.h Mon Nov 12 17:35:40 2007
@@ -47,7 +47,7 @@
virtual const char * widgetClass() const { return "YPushButton"; }
/**
- * Get the label (the text on the RadioButton).
+ * Get the label (the text on the button).
**/
string label() const;
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YTypes.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YTypes.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YTypes.h Mon Nov 12 17:35:40 2007
@@ -25,7 +25,8 @@
#include <list>
-typedef double YLayoutSize_t;
+typedef double YLayoutSize_t;
+typedef long long YFileSize_t;
class YWidget;
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUI.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUI.h Mon Nov 12 17:35:40 2007
@@ -459,20 +459,6 @@
// Widget creation methods - OBSOLETE, use widgetFactories instead
/**
- * Creates a DownloadProgress widget.
- *
- * This is a special widget that the UI may or may not support.
- * Overwrite this method at your own discretion.
- * If you do, remember to overwrite the has...() method as well!
- **/
- virtual YWidget * createDownloadProgress( YWidget *parent, YWidgetOpt & opt,
- const YCPString & label,
- const YCPString & filename,
- int expectedSize );
-
- virtual bool hasDownloadProgress() { return false; }
-
- /**
* Creates a DumbTab.
*
* This is a special widget that the UI may or may not support.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUISymbols.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUISymbols.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUISymbols.h Mon Nov 12 17:35:40 2007
@@ -150,6 +150,7 @@
#define YUIProperty_Cell "Cell"
#define YUIProperty_CurrentBranch "CurrentBranch"
#define YUIProperty_CurrentButton "CurrentButton"
+#define YUIProperty_CurrentSize "CurrentSize"
#define YUIProperty_CurrentItem "CurrentItem"
#define YUIProperty_DebugLabel "DebugLabel"
#define YUIProperty_DialogDebugLabel "DialogDebugLabel"
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc Mon Nov 12 17:35:40 2007
@@ -87,7 +87,7 @@
if ( symbol == YUISpecialWidget_DummySpecialWidget ) hasWidget = fact->hasDummySpecialWidget();
else if ( symbol == YUISpecialWidget_BarGraph ) hasWidget = fact->hasBarGraph();
else if ( symbol == YUISpecialWidget_DumbTab ) hasWidget = hasDumbTab();
- else if ( symbol == YUISpecialWidget_DownloadProgress ) hasWidget = hasDownloadProgress();
+ else if ( symbol == YUISpecialWidget_DownloadProgress ) hasWidget = fact->hasDownloadProgress();
else if ( symbol == YUISpecialWidget_HMultiProgressMeter ) hasWidget = fact->hasMultiProgressMeter();
else if ( symbol == YUISpecialWidget_VMultiProgressMeter ) hasWidget = fact->hasMultiProgressMeter();
else if ( symbol == YUISpecialWidget_Slider ) hasWidget = fact->hasSlider();
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI_special_widgets.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUI_special_widgets.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUI_special_widgets.cc Mon Nov 12 17:35:40 2007
@@ -34,25 +34,6 @@
*
* UIs that overwrite any of those should overwrite the corresponding
* has...() method as well!
- **/
-
-YWidget * YUI::createDownloadProgress( YWidget *parent, YWidgetOpt & opt,
- const YCPString & label,
- const YCPString & filename,
- int expectedSize )
-{
- y2error( "Default createDownloadProgress() method called - "
- "forgot to call HasSpecialWidget()?" );
-
- return 0;
-}
-
-
-/**
- * Default low level specific UI implementations for optional widgets.
- *
- * UIs that overwrite any of those should overwrite the corresponding
- * has...() method as well!
*/
Modified: branches/tmp/sh/mod-ui/qt/src/YQDownloadProgress.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQDownlo…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQDownloadProgress.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQDownloadProgress.cc Mon Nov 12 17:35:40 2007
@@ -29,85 +29,101 @@
#include "YQWidgetCaption.h"
-YQDownloadProgress::YQDownloadProgress( QWidget * parent,
- const YWidgetOpt & opt,
- const YCPString & label,
- const YCPString & filename,
- int expectedSize )
- : QVBox( parent )
- , YDownloadProgress( opt, label, filename, expectedSize )
+YQDownloadProgress::YQDownloadProgress( YWidget * parent,
+ const string & label,
+ const string & filename,
+ YFileSize_t expectedSize )
+ : QVBox( (QWidget *) parent->widgetRep() )
+ , YDownloadProgress( parent, label, filename, expectedSize )
{
setWidgetRep( this );
setMargin( YQWidgetMargin );
- _caption = new YQWidgetCaption( this, label->value() );
+ _caption = new YQWidgetCaption( this, label );
YUI_CHECK_NEW( _caption );
-
- _qt_progress = new QProgressBar( this );
- YUI_CHECK_NEW( _qt_progress );
-
- _qt_progress->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- _qt_progress->setTotalSteps( expectedSize );
- _qt_progress->setProgress( currentFileSize() );
+
+ _qt_progressBar = new QProgressBar( this );
+ YUI_CHECK_NEW( _qt_progressBar );
+
+ _qt_progressBar->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ _qt_progressBar->setTotalSteps( 100 ); // Using percent
+ _qt_progressBar->setProgress( currentPercent() );
_timer = new QTimer( this );
- connect( _timer, SIGNAL( timeout() ), this, SLOT( pollFileSize() ) );
+
+ connect( _timer, SIGNAL( timeout() ),
+ this, SLOT ( pollFileSize() ) );
_timer->start( 250, // millisec
false ); // single shot?
}
-void YQDownloadProgress::setEnabled( bool enabled )
+YQDownloadProgress::~YQDownloadProgress()
{
- _caption->setEnabled( enabled );
- _qt_progress->setEnabled( enabled );
- YWidget::setEnabled( enabled );
+ // NOP
}
-int YQDownloadProgress::preferredWidth()
+void
+YQDownloadProgress::setLabel( const string & label )
{
- return sizeHint().width();
+ _caption->setText( label );
+ YDownloadProgress::setLabel( label );
}
-int YQDownloadProgress::preferredHeight()
+void
+YQDownloadProgress::setFilename( const string & filename )
{
- return sizeHint().height();
+ YDownloadProgress::setFilename( filename );
+ _qt_progressBar->setProgress( currentPercent() );
}
-void YQDownloadProgress::setSize( int newWidth, int newHeight )
+void
+YQDownloadProgress::setExpectedSize( YFileSize_t expectedSize )
{
- resize( newWidth, newHeight );
+ _qt_progressBar->setProgress( currentPercent() );
+ YDownloadProgress::setExpectedSize( expectedSize );
}
-void YQDownloadProgress::setLabel( const YCPString & label )
+void
+YQDownloadProgress::pollFileSize()
{
- _caption->setText( label->value() );
- YDownloadProgress::setLabel( label );
+ _qt_progressBar->setProgress( currentPercent() );
}
-void YQDownloadProgress::setExpectedSize( int expectedSize )
+void
+YQDownloadProgress::setEnabled( bool enabled )
{
- _qt_progress->setTotalSteps( expectedSize );
- _qt_progress->setProgress( currentFileSize() );
- YDownloadProgress::setExpectedSize( expectedSize );
+ _caption->setEnabled( enabled );
+ _qt_progressBar->setEnabled( enabled );
+ YWidget::setEnabled( enabled );
}
-void YQDownloadProgress::pollFileSize()
+int
+YQDownloadProgress::preferredWidth()
{
- long size = currentFileSize();
+ return sizeHint().width();
+}
+
- if ( size > (long) expectedSize() )
- size = (long) expectedSize();
- _qt_progress->setProgress( size );
+int
+YQDownloadProgress::preferredHeight()
+{
+ return sizeHint().height();
}
+void
+YQDownloadProgress::setSize( int newWidth, int newHeight )
+{
+ resize( newWidth, newHeight );
+}
+
#include "YQDownloadProgress.moc"
Modified: branches/tmp/sh/mod-ui/qt/src/YQDownloadProgress.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQDownlo…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQDownloadProgress.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQDownloadProgress.h Mon Nov 12 17:35:40 2007
@@ -21,7 +21,6 @@
#define YQDownloadProgress_h
#include <qvbox.h>
-#include <ycp/YCPString.h>
#include "YDownloadProgress.h"
class YQWidgetCaption;
@@ -37,11 +36,36 @@
/**
* Constructor.
**/
- YQDownloadProgress( QWidget * parent,
- const YWidgetOpt & opt,
- const YCPString & label,
- const YCPString & filename,
- int expectedSize );
+ YQDownloadProgress( YWidget * parent,
+ const string & label,
+ const string & filename,
+ YFileSize_t expectedSize );
+
+ /**
+ * Destructor.
+ **/
+ virtual ~YQDownloadProgress();
+
+ /**
+ * Set the label (the text above the progress bar).
+ *
+ * Reimplemented from YDownloadProgress.
+ **/
+ virtual void setLabel( const string & label );
+
+ /**
+ * Set the name of a new file to monitor.
+ *
+ * Reimplemented from YDownloadProgress.
+ **/
+ virtual void setFilename( const string & filename );
+
+ /**
+ * Change the expected file size.
+ *
+ * Reimplemented from YDownloadProgress.
+ **/
+ virtual void setExpectedSize( YFileSize_t expectedSize );
/**
* Set enabled/disabled state.
@@ -71,21 +95,6 @@
**/
virtual void setSize( int newWidth, int newHeight );
- /**
- * Change the label.
- * Calls YDownloadProgress::setLabel at the end.
- * Inherited from YDownloadProgress.
- **/
- void setLabel( const YCPString & label );
-
-
- /**
- * Change the expected file size.
- * Calls YDownloadProgress::setExpectedSize() at the end.
- * Inherited from YDownloadProgress.
- **/
- void setExpectedSize( int expectedSize );
-
public slots:
/**
@@ -97,7 +106,7 @@
protected:
YQWidgetCaption * _caption;
- QProgressBar * _qt_progress;
+ QProgressBar * _qt_progressBar;
QTimer * _timer;
};
Modified: branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQOption…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.cc Mon Nov 12 17:35:40 2007
@@ -236,15 +236,21 @@
bool YQOptionalWidgetFactory::hasDownloadProgress()
{
- return false;
+ return true;
}
YQDownloadProgress *
YQOptionalWidgetFactory::createDownloadProgress( YWidget * parent,
const string & label,
const string & filename,
- long expectedFileSize )
+ YFileSize_t expectedSize )
{
- THROW_UNSUPPORTED( "YQDownloadProgress" );
+ YQDownloadProgress * downloadProgress = new YQDownloadProgress( parent,
+ label,
+ filename,
+ expectedSize );
+ YUI_CHECK_NEW( downloadProgress );
+
+ return downloadProgress;
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQOption…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.h Mon Nov 12 17:35:40 2007
@@ -107,7 +107,7 @@
virtual YQDownloadProgress * createDownloadProgress ( YWidget * parent,
const string & label,
const string & filename,
- long expectedFileSize );
+ YFileSize_t expectedFileSize );
protected:
Modified: branches/tmp/sh/mod-ui/qt/src/YQUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQUI.h?r…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQUI.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQUI.h Mon Nov 12 17:35:40 2007
@@ -432,40 +432,10 @@
/*** Widget creation methods for optional widgets, all reimplemented from YUI ***/
- bool hasDownloadProgress();
- YWidget * createDownloadProgress ( YWidget * parent,
- YWidgetOpt & opt,
- const YCPString & label,
- const YCPString & filename,
- int expectedSize );
-
bool hasDumbTab();
YWidget * createDumbTab ( YWidget * parent,
YWidgetOpt & opt );
- bool hasSlider();
- YWidget * createSlider ( YWidget * parent,
- YWidgetOpt & opt,
- const YCPString & label,
- int minValue,
- int maxValue,
- int initialValue );
-
- bool hasPartitionSplitter();
- YWidget * createPartitionSplitter( YWidget * parent,
- YWidgetOpt & opt,
- int usedSize,
- int totalFreeSize,
- int newPartSize,
- int minNewPartSize,
- int minFreeSize,
- const YCPString & usedLabel,
- const YCPString & freeLabel,
- const YCPString & newPartLabel,
- const YCPString & freeFieldLabel,
- const YCPString & newPartFieldLabel );
-
-
/*** END widget creation methods ***/
Modified: branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQUI_wid…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc Mon Nov 12 17:35:40 2007
@@ -52,24 +52,6 @@
//========= Optional widgets ==================================================
-bool YQUI::hasDownloadProgress()
-{
- return true;
-}
-
-YWidget * YQUI::createDownloadProgress ( YWidget * parent,
- YWidgetOpt & opt,
- const YCPString & label,
- const YCPString & filename,
- int expectedSize)
-{
- return new YQDownloadProgress( (QWidget *) ( parent->widgetRep() ),
- opt,
- label,
- filename,
- expectedSize );
-}
-
bool YQUI::hasDumbTab()
{
--
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] r41983 - /branches/tmp/sh/mod-ui/core/base/tools/devtools/generateYCPWrappers
by sh-sh-sh@svn.opensuse.org 12 Nov '07
by sh-sh-sh@svn.opensuse.org 12 Nov '07
12 Nov '07
Author: sh-sh-sh
Date: Mon Nov 12 16:56:06 2007
New Revision: 41983
URL: http://svn.opensuse.org/viewcvs/yast?rev=41983&view=rev
Log:
copied from trunk
Modified:
branches/tmp/sh/mod-ui/core/base/tools/devtools/generateYCPWrappers
Modified: branches/tmp/sh/mod-ui/core/base/tools/devtools/generateYCPWrappers
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/base/tools…
==============================================================================
--- branches/tmp/sh/mod-ui/core/base/tools/devtools/generateYCPWrappers (original)
+++ branches/tmp/sh/mod-ui/core/base/tools/devtools/generateYCPWrappers Mon Nov 12 16:56:06 2007
@@ -59,7 +59,6 @@
print CALL $generated;
print REGISTER $generated;
-print CALL "\t\tstatic const char * err_fmt = \"Parameter %d is nil, %s is required\";\n";
my $position = 0;
while (@exports)
@@ -83,7 +82,7 @@
push (@tests, "// m_param$paramcount may be nil");
}
else {
- push (@tests, "if (m_param$paramcount->isVoid()) {ycp2error(err_fmt, $paramcount, \"$type\"); return YCPVoid();}");
+ push (@tests, "if (m_param$paramcount->isVoid()) {ycp2error(\"Parameter %d is nil, %s is required\", $paramcount, \"$type\"); return YCPVoid();}");
}
$type = "m_param" . $paramcount . "->as" . $type . "()" ;
--
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] r41982 - /trunk/core/base/tools/devtools/generateYCPWrappers
by mvidner@svn.opensuse.org 12 Nov '07
by mvidner@svn.opensuse.org 12 Nov '07
12 Nov '07
Author: mvidner
Date: Mon Nov 12 16:52:07 2007
New Revision: 41982
URL: http://svn.opensuse.org/viewcvs/yast?rev=41982&view=rev
Log:
Do away with dozens of "format not a string literal, argument types
not checked" by repeating the format string over and over. The
linker will optimize it out.
Modified:
trunk/core/base/tools/devtools/generateYCPWrappers
Modified: trunk/core/base/tools/devtools/generateYCPWrappers
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/base/tools/devtools/generat…
==============================================================================
--- trunk/core/base/tools/devtools/generateYCPWrappers (original)
+++ trunk/core/base/tools/devtools/generateYCPWrappers Mon Nov 12 16:52:07 2007
@@ -59,7 +59,6 @@
print CALL $generated;
print REGISTER $generated;
-print CALL "\t\tstatic const char * err_fmt = \"Parameter %d is nil, %s is required\";\n";
my $position = 0;
while (@exports)
@@ -83,7 +82,7 @@
push (@tests, "// m_param$paramcount may be nil");
}
else {
- push (@tests, "if (m_param$paramcount->isVoid()) {ycp2error(err_fmt, $paramcount, \"$type\"); return YCPVoid();}");
+ push (@tests, "if (m_param$paramcount->isVoid()) {ycp2error(\"Parameter %d is nil, %s is required\", $paramcount, \"$type\"); return YCPVoid();}");
}
$type = "m_param" . $paramcount . "->as" . $type . "()" ;
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
12 Nov '07
Author: lslezak
Date: Mon Nov 12 16:41:37 2007
New Revision: 41981
URL: http://svn.opensuse.org/viewcvs/yast?rev=41981&view=rev
Log:
Created tag stable-2_16_5 for product-creator
Added:
tags/stable-2_16_5/product-creator/
- copied from r41980, trunk/product-creator/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r41980 - in /branches/tmp/sh/mod-ui/web-wt/src: Makefile.am YWebApplication.cc YWebApplication.h YWebUI_core.cc
by dmacvicar@svn.opensuse.org 12 Nov '07
by dmacvicar@svn.opensuse.org 12 Nov '07
12 Nov '07
Author: dmacvicar
Date: Mon Nov 12 16:36:39 2007
New Revision: 41980
URL: http://svn.opensuse.org/viewcvs/yast?rev=41980&view=rev
Log:
fixes YUIComponent.cc(createUI):93 createUI() called before
setServerOptions()
Added:
branches/tmp/sh/mod-ui/web-wt/src/YWebApplication.cc
branches/tmp/sh/mod-ui/web-wt/src/YWebApplication.h
Modified:
branches/tmp/sh/mod-ui/web-wt/src/Makefile.am
branches/tmp/sh/mod-ui/web-wt/src/YWebUI_core.cc
Modified: branches/tmp/sh/mod-ui/web-wt/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/web-wt/src/Make…
==============================================================================
--- branches/tmp/sh/mod-ui/web-wt/src/Makefile.am (original)
+++ branches/tmp/sh/mod-ui/web-wt/src/Makefile.am Mon Nov 12 16:36:39 2007
@@ -29,7 +29,8 @@
YWebUI_widgets.cc \
YWebUI_builtins.cc \
YWebWidgetFactory.cc \
- YWebDialog.cc
+ YWebDialog.cc \
+ YWebApplication.cc
# YQPackageSelectorPlugin.cc \
Added: branches/tmp/sh/mod-ui/web-wt/src/YWebApplication.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/web-wt/src/YWeb…
==============================================================================
--- branches/tmp/sh/mod-ui/web-wt/src/YWebApplication.cc (added)
+++ branches/tmp/sh/mod-ui/web-wt/src/YWebApplication.cc Mon Nov 12 16:36:39 2007
@@ -0,0 +1,15 @@
+
+#include "YWebApplication.h"
+
+
+YWebApplication::YWebApplication()
+{
+
+}
+
+
+YWebApplication::~YWebApplication()
+{
+
+}
+
Added: branches/tmp/sh/mod-ui/web-wt/src/YWebApplication.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/web-wt/src/YWeb…
==============================================================================
--- branches/tmp/sh/mod-ui/web-wt/src/YWebApplication.h (added)
+++ branches/tmp/sh/mod-ui/web-wt/src/YWebApplication.h Mon Nov 12 16:36:39 2007
@@ -0,0 +1,27 @@
+
+#ifndef YWebApplication_h
+#define YWebApplication_h
+
+#include "YApplication.h"
+
+
+class YWebApplication: public YApplication
+{
+protected:
+
+ friend class YWebUI;
+
+ /**
+ * Constructor.
+ *
+ * Use YUI::app() to get the singleton for this class.
+ **/
+ YWebApplication();
+
+ /**
+ * Destructor.
+ **/
+ virtual ~YWebApplication();
+};
+
+#endif // YWebApplication_h
Modified: branches/tmp/sh/mod-ui/web-wt/src/YWebUI_core.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/web-wt/src/YWeb…
==============================================================================
--- branches/tmp/sh/mod-ui/web-wt/src/YWebUI_core.cc (original)
+++ branches/tmp/sh/mod-ui/web-wt/src/YWebUI_core.cc Mon Nov 12 16:36:39 2007
@@ -26,10 +26,10 @@
#define y2log_component "web-ui"
#include <ycp/y2log.h>
-#include <yui/YApplication.h>
#include <WApplication>
#include "YWebUI.h"
+#include "YWebApplication.h"
#include "YWebWidgetFactory.h"
#include "YWebOptionalWidgetFactory.h"
#include "YEvent.h"
@@ -103,10 +103,9 @@
YApplication *
YWebUI::createApplication()
{
-// YApplication * app = new YApplication();
-// YUI_CHECK_NEW( app );
-// FIXME
- return 0L;
+ YWebApplication * app = new YWebApplication();
+ YUI_CHECK_NEW( app );
+ return app;
}
--
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] r41979 - in /trunk/product-creator: VERSION package/yast2-product-creator.changes
by lslezak@svn.opensuse.org 12 Nov '07
by lslezak@svn.opensuse.org 12 Nov '07
12 Nov '07
Author: lslezak
Date: Mon Nov 12 16:20:17 2007
New Revision: 41979
URL: http://svn.opensuse.org/viewcvs/yast?rev=41979&view=rev
Log:
- 2.16.5
Modified:
trunk/product-creator/VERSION
trunk/product-creator/package/yast2-product-creator.changes
Modified: trunk/product-creator/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/VERSION?rev=4197…
==============================================================================
--- trunk/product-creator/VERSION (original)
+++ trunk/product-creator/VERSION Mon Nov 12 16:20:17 2007
@@ -1 +1 @@
-2.16.4
+2.16.5
Modified: trunk/product-creator/package/yast2-product-creator.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/package/yast2-pr…
==============================================================================
--- trunk/product-creator/package/yast2-product-creator.changes (original)
+++ trunk/product-creator/package/yast2-product-creator.changes Mon Nov 12 16:20:17 2007
@@ -3,6 +3,7 @@
- select the current language if there is no language selected,
prevent the solver from allocating too much resources (#339756)
+- 2.16.5
-------------------------------------------------------------------
Mon Nov 12 13:11:58 CET 2007 - jsuchome(a)suse.cz
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r41978 - in /trunk/product-creator: package/yast2-product-creator.changes src/ProductCreator.ycp src/dialogs.ycp
by lslezak@svn.opensuse.org 12 Nov '07
by lslezak@svn.opensuse.org 12 Nov '07
12 Nov '07
Author: lslezak
Date: Mon Nov 12 16:12:05 2007
New Revision: 41978
URL: http://svn.opensuse.org/viewcvs/yast?rev=41978&view=rev
Log:
- select the current language if there is no language selected,
prevent the solver from allocating too much resources (#339756)
Modified:
trunk/product-creator/package/yast2-product-creator.changes
trunk/product-creator/src/ProductCreator.ycp
trunk/product-creator/src/dialogs.ycp
Modified: trunk/product-creator/package/yast2-product-creator.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/package/yast2-pr…
==============================================================================
--- trunk/product-creator/package/yast2-product-creator.changes (original)
+++ trunk/product-creator/package/yast2-product-creator.changes Mon Nov 12 16:12:05 2007
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Mon Nov 12 15:35:42 CET 2007 - lslezak(a)suse.cz
+
+- select the current language if there is no language selected,
+ prevent the solver from allocating too much resources (#339756)
+
+-------------------------------------------------------------------
Mon Nov 12 13:11:58 CET 2007 - jsuchome(a)suse.cz
- image-creator:
Modified: trunk/product-creator/src/ProductCreator.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/src/ProductCreat…
==============================================================================
--- trunk/product-creator/src/ProductCreator.ycp (original)
+++ trunk/product-creator/src/ProductCreator.ycp Mon Nov 12 16:12:05 2007
@@ -2219,7 +2219,20 @@
return;
}
-
+/**
+ * Check if there is a language selected in the package manager,
+ * if not then select the language used in the UI. Htis prevents the solver
+ * from allocating too many resources (see bug #339756)
+ */
+global void CheckLanguage()
+{
+ if (Pkg::GetPackageLocale() == "" && Pkg::GetAdditionalLocales() == [])
+ {
+ y2warning("No language selected, preselecting the current UI language: %1", UI::GetLanguage(true));
+ // if there is nothing selected yet then preset the language
+ Pkg::SetPackageLocale(UI::GetLanguage(true));
+ }
+}
/**
* Set packages to be copied to iso image tree
@@ -2297,6 +2310,8 @@
Pkg::DoProvide(packages);
+ CheckLanguage();
+
boolean ret = Pkg::PkgSolve(false);
return (ret);
Modified: trunk/product-creator/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/src/dialogs.ycp?…
==============================================================================
--- trunk/product-creator/src/dialogs.ycp (original)
+++ trunk/product-creator/src/dialogs.ycp Mon Nov 12 16:12:05 2007
@@ -925,6 +925,9 @@
list<string> addons = patterns;
+ // ensure that a langugage is selected
+ ProductCreator::CheckLanguage();
+
if (size(addons) > 0 || ProductCreator::Config["base"]:"" != "")
{
y2milestone("base pattern: %1, addons: %2", base_pattern, addons);
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
12 Nov '07
Author: jsuchome
Date: Mon Nov 12 16:04:27 2007
New Revision: 41977
URL: http://svn.opensuse.org/viewcvs/yast?rev=41977&view=rev
Log:
Created tag stable-2_16_2 for country
Added:
tags/stable-2_16_2/country/
- copied from r41976, trunk/country/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0