Author: rpmcruz
Date: Wed Jul 14 12:57:59 2010
New Revision: 62247
URL: http://svn.opensuse.org/viewcvs/yast?rev=62247&view=rev
Log:
Undo reverse.
Modified:
trunk/gtk/ChangeLog
trunk/gtk/src/YGDialog.cc
trunk/gtk/src/YGDialog.h
trunk/gtk/src/YGPackageSelectorPluginStub.cc
trunk/gtk/src/YGUI.cc
trunk/gtk/src/YGUI.h
trunk/gtk/src/pkg/YGPackageSelector.cc
trunk/gtk/src/pkg/ygtkpkgdetailview.cc
Modified: trunk/gtk/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/ChangeLog?rev=62247&r1=62246&r2=62247&view=diff
==============================================================================
--- trunk/gtk/ChangeLog (original)
+++ trunk/gtk/ChangeLog Wed Jul 14 12:57:59 2010
@@ -1,5 +1,9 @@
2010-07-14 Ricardo Cruz
+ * Undone reversion.
+
+2010-07-14 Ricardo Cruz
+
* Reversed some of previous changes for build service
process.
Modified: trunk/gtk/src/YGDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGDialog.cc?rev=62247&r1=62246&r2=62247&view=diff
==============================================================================
--- trunk/gtk/src/YGDialog.cc (original)
+++ trunk/gtk/src/YGDialog.cc Wed Jul 14 12:57:59 2010
@@ -23,9 +23,6 @@
be a YGDialog and is swap-able.
*/
-#define DEFAULT_WIDTH 750
-#define DEFAULT_HEIGHT 650
-
class YGWindow;
static YGWindow *main_window = 0;
@@ -93,7 +90,19 @@
}
if (_main_window) {
- int width = DEFAULT_WIDTH, height = DEFAULT_HEIGHT;
+ static int width = 0, height;
+ if (!width) {
+ int char_width = YGUtils::getCharsWidth (m_widget, 1);
+
+ fprintf (stderr, "char width: %d\n", char_width);
+ if (char_width < 7)
+ { width = 750; height = 650; }
+ else
+ { width = 800; height = 750; }
+ if (YGUI::ui()->isPkgSelector())
+ height = width;
+ }
+
if (YGUI::ui()->defaultWidth())
width = YGUI::ui()->defaultWidth();
if (YGUI::ui()->defaultHeight())
@@ -355,7 +364,7 @@
m_window->setChild (this);
}
-void YGDialog::present()
+void YGDialog::blink()
{
GtkWindow *window = GTK_WINDOW (m_window->getWidget());
if (!gtk_window_is_active (window))
@@ -429,16 +438,6 @@
}
}
-void YGDialog::setMinSize (int width, int height)
-{
- GtkWidget *window = m_window->getWidget();
- width = MIN (width, YUI::app()->displayWidth());
- height = MIN (height, YUI::app()->displayHeight());
- width = MAX (width, window->allocation.width),
- height = MAX (height, window->allocation.height);
- gtk_window_resize (GTK_WINDOW (window), width, height);
-}
-
void YGDialog::highlight (YWidget *ywidget)
{
struct inner {
@@ -520,7 +519,7 @@
g_free (str);
m_stickyTitle = sticky;
}
- present();
+ blink();
}
extern "C" {
Modified: trunk/gtk/src/YGDialog.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGDialog.h?rev=62247&r1=62246&r2=62247&view=diff
==============================================================================
--- trunk/gtk/src/YGDialog.h (original)
+++ trunk/gtk/src/YGDialog.h Wed Jul 14 12:57:59 2010
@@ -35,11 +35,10 @@
static GtkWindow *currentWindow();
virtual void doSetSize (int width, int height);
- void setMinSize (int width, int height); // used internally by YGPackageSelector.cc
virtual void openInternal();
virtual void activate();
- void present();
+ void blink();
virtual YEvent *waitForEventInternal (int timeout_millisec);
virtual YEvent *pollEventInternal();
Modified: trunk/gtk/src/YGPackageSelectorPluginStub.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGPackageSelectorPluginStub.cc?rev=62247&r1=62246&r2=62247&view=diff
==============================================================================
--- trunk/gtk/src/YGPackageSelectorPluginStub.cc (original)
+++ trunk/gtk/src/YGPackageSelectorPluginStub.cc Wed Jul 14 12:57:59 2010
@@ -11,12 +11,6 @@
#include
#include
-bool YGUI::pkgSelectorParse (const char *arg)
-{ return false; }
-
-void YGUI::pkgSelectorSize (int *width, int *height)
-{ *width = 750; *height = 750; }
-
class YGPackageSelectorPluginStub : public YPackageSelectorPlugin
{
YGPackageSelectorPluginIf *impl;
Modified: trunk/gtk/src/YGUI.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUI.cc?rev=62247&r1=62246&r2=62247&view=diff
==============================================================================
--- trunk/gtk/src/YGUI.cc (original)
+++ trunk/gtk/src/YGUI.cc Wed Jul 14 12:57:59 2010
@@ -118,7 +118,7 @@
const char *argp = argv[i];
if (argp[0] != '-') {
if (!strcmp (argp, "sw_single") || !strcmp (argp, "online_update"))
- YGUI::pkgSelectorSize (&m_default_width, &m_default_height);
+ m_swsingle = true;
continue;
}
argp++;
@@ -143,7 +143,6 @@
));
exit (0);
}
- else if (pkgSelectorParse (argp)) ;
}
gtk_init (&argc, &argv);
Modified: trunk/gtk/src/YGUI.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUI.h?rev=62247&r1=62246&r2=62247&view=diff
==============================================================================
--- trunk/gtk/src/YGUI.h (original)
+++ trunk/gtk/src/YGUI.h Wed Jul 14 12:57:59 2010
@@ -63,20 +63,17 @@
static gboolean busy_timeout_cb (gpointer data);
// window-related arguments
- bool m_have_wm, m_no_border, m_fullscreen;
+ bool m_have_wm, m_no_border, m_fullscreen, m_swsingle;
int m_default_width, m_default_height;
- bool pkgSelectorParse (const char *arg);
-
public:
- void pkgSelectorSize (int *width, int *height);
-
// Helpers for internal use [ visibility hidden ]
bool setFullscreen() const { return m_fullscreen; }
bool hasWM() const { return m_have_wm; }
bool unsetBorder() const { return m_no_border; }
int defaultWidth() const { return m_default_width; }
- int defaultHeight() const { return m_default_height; }
+ int defaultHeight() const { return m_default_height; }
+ bool isPkgSelector() const { return m_swsingle; }
};
// debug helpers.
Modified: trunk/gtk/src/pkg/YGPackageSelector.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/YGPackageSelector.cc?rev=62247&r1=62246&r2=62247&view=diff
==============================================================================
--- trunk/gtk/src/pkg/YGPackageSelector.cc (original)
+++ trunk/gtk/src/pkg/YGPackageSelector.cc Wed Jul 14 12:57:59 2010
@@ -177,10 +177,14 @@
status->select (3);
m_queryWidgets.push_back (status);
+
GtkWidget *vpaned = gtk_vpaned_new();
gtk_paned_pack1 (GTK_PANED (vpaned), m_combo->getWidget(), TRUE, FALSE);
gtk_paned_pack2 (GTK_PANED (vpaned), status->getWidget(), FALSE, FALSE);
- gtk_paned_set_position (GTK_PANED (vpaned), 485);
+ if (YGUtils::getCharsWidth (vpaned, 1) < 7)
+ gtk_paned_set_position (GTK_PANED (vpaned), 485);
+ else
+ gtk_paned_set_position (GTK_PANED (vpaned), 500);
return vpaned;
}
@@ -193,7 +197,10 @@
GtkWidget *hpaned = gtk_hpaned_new();
gtk_paned_pack1 (GTK_PANED (hpaned), createSidebar(), FALSE, TRUE);
gtk_paned_pack2 (GTK_PANED (hpaned), createMainArea(), TRUE, FALSE);
- gtk_paned_set_position (GTK_PANED (hpaned), 200);
+ if (YGUtils::getCharsWidth (hpaned, 1) < 7)
+ gtk_paned_set_position (GTK_PANED (hpaned), 200);
+ else
+ gtk_paned_set_position (GTK_PANED (hpaned), 230);
m_widget = gtk_vbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX (m_widget), hpaned, TRUE, TRUE, 0);
@@ -577,7 +584,8 @@
static void vpaned_allocate_cb (GtkWidget *vpaned, GtkAllocation *alloc, Impl *pThis)
{
if (!g_object_get_data (G_OBJECT (vpaned), "init")) { // only once
- int pos = MAX (alloc->height / 2, alloc->height - 180);
+ int height = (YGUtils::getCharsWidth (vpaned, 1) < 7) ? 180 : 220;
+ int pos = MAX (alloc->height / 2, alloc->height - height);
gtk_paned_set_position (GTK_PANED (vpaned), pos);
g_object_set_data (G_OBJECT (vpaned), "init", GINT_TO_POINTER (1));
}
@@ -668,9 +676,6 @@
setBorder (0);
YGDialog *dialog = YGDialog::currentDialog();
dialog->setCloseCallback (confirm_cb, this);
- int width, height;
- YGUI::ui()->pkgSelectorSize (&width, &height);
- dialog->setMinSize (width, height);
const char *icon, *title, **help;
if (onlineUpdateMode()) {
Modified: trunk/gtk/src/pkg/ygtkpkgdetailview.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgdetailview.cc?rev=62247&r1=62246&r2=62247&view=diff
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgdetailview.cc (original)
+++ trunk/gtk/src/pkg/ygtkpkgdetailview.cc Wed Jul 14 12:57:59 2010
@@ -339,16 +339,16 @@
ZyppPackage zpkg = castZyppPackage (zobj);
std::string str;
- std::string b ("<i>"), _b ("</i> "), br ("<br/>");
+ std::string b ("<i>"), _b ("</i> "), i (""), _i(""), br ("<br/>");
str.reserve (2048);
- str += b + _("Size:") + _b + zobj->installSize().asString();
- str += br + b + _("License:") + _b + zpkg->license();
+ str += b + _("Size:") + _b + i + zobj->installSize().asString() + _i;
+ str += br + b + _("License:") + _b + i + zpkg->license() + _i;
if (zsel->hasInstalledObj())
- str += br + b + ("Installed at:") + _b +
- zsel->installedObj()->installtime().form ("%x");
+ str += br + b + ("Installed at:") + _b + i +
+ zsel->installedObj()->installtime().form ("%x") + _i;
if (zsel->hasCandidateObj())
- str += br + b + ("Latest build:") + _b +
- zsel->candidateObj()->buildtime().form ("%x");
+ str += br + b + ("Latest build:") + _b + i +
+ zsel->candidateObj()->buildtime().form ("%x") + _i;
ygtk_rich_text_set_text (YGTK_RICH_TEXT (text), str.c_str());
}
@@ -720,6 +720,8 @@
ygtk_rich_text_set_text (YGTK_RICH_TEXT (col),
("<i>" + col1 + "</i>").c_str());
gtk_box_pack_start (GTK_BOX (hbox), col, FALSE, TRUE, 0);
+ // by settings both the two following "col" text widgets with the same
+ // fixed width, and expanded=True, we ensure all rows have the same size
col = ygtk_rich_text_new();
gtk_widget_set_size_request (col, 80, -1);
ygtk_rich_text_set_text (YGTK_RICH_TEXT (col), col2.c_str());
@@ -758,10 +760,8 @@
Ypp::Selectable sel = list.get (0);
clear();
- std::string installed_str (_("<b>Installed Version</b>"));
- std::string candidate_str (_("<b>Candidate Version</b>"));
- installed_str = "<i>" + installed_str + "</i>";
- candidate_str = "<i>" + candidate_str + "</i>";
+ std::string installed_str (_("<i>Installed Version</i>"));
+ std::string candidate_str (_("<i>Available Version</i>"));
if (sel.hasInstalledVersion())
installed_str += "<br>" + sel.installed().number();
if (sel.hasCandidateVersion())
@@ -1052,7 +1052,7 @@
Ypp::Selectable sel = list.get (0);
std::string str (authors (sel));
if (str.empty())
- ygtk_rich_text_set_text (YGTK_RICH_TEXT (text), _("<i>Unspecified attribute.</i>"));
+ ygtk_rich_text_set_text (YGTK_RICH_TEXT (text), _("<i>Not specified.</i>"));
else
ygtk_rich_text_set_text (YGTK_RICH_TEXT (text), str.c_str());
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org