[yast-commit] r62242 - in /trunk/gtk: ChangeLog src/YGDialog.cc src/YGDialog.h src/YGPackageSelectorPluginStub.cc src/YGUI.cc src/YGUI.h src/pkg/YGPackageSelector.cc src/pkg/ygtkpkgdetailview.cc
Author: rpmcruz Date: Wed Jul 14 12:40:53 2010 New Revision: 62242 URL: http://svn.opensuse.org/viewcvs/yast?rev=62242&view=rev Log: * Reversed some of previous changes for build service process. 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=62242&r1=62241&r2=62242&view=diff ============================================================================== --- trunk/gtk/ChangeLog (original) +++ trunk/gtk/ChangeLog Wed Jul 14 12:40:53 2010 @@ -1,3 +1,8 @@ +2010-07-14 Ricardo Cruz <rpmcruz@alunos.dcc.fc.up.pt> + + * Reversed some of previous changes for build service + process. + 2010-07-13 Ricardo Cruz <rpmcruz@alunos.dcc.fc.up.pt> * src/YGDialog.cc & src/pkg/YGPackageSelector.cc: as Modified: trunk/gtk/src/YGDialog.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGDialog.cc?rev=62242&r1=62241&r2=62242&view=diff ============================================================================== --- trunk/gtk/src/YGDialog.cc (original) +++ trunk/gtk/src/YGDialog.cc Wed Jul 14 12:40:53 2010 @@ -23,6 +23,9 @@ be a YGDialog and is swap-able. */ +#define DEFAULT_WIDTH 750 +#define DEFAULT_HEIGHT 650 + class YGWindow; static YGWindow *main_window = 0; @@ -90,19 +93,7 @@ } if (_main_window) { - 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; - } - + int width = DEFAULT_WIDTH, height = DEFAULT_HEIGHT; if (YGUI::ui()->defaultWidth()) width = YGUI::ui()->defaultWidth(); if (YGUI::ui()->defaultHeight()) @@ -364,7 +355,7 @@ m_window->setChild (this); } -void YGDialog::blink() +void YGDialog::present() { GtkWindow *window = GTK_WINDOW (m_window->getWidget()); if (!gtk_window_is_active (window)) @@ -438,6 +429,16 @@ } } +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 { @@ -519,7 +520,7 @@ g_free (str); m_stickyTitle = sticky; } - blink(); + present(); } extern "C" { Modified: trunk/gtk/src/YGDialog.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGDialog.h?rev=62242&r1=62241&r2=62242&view=diff ============================================================================== --- trunk/gtk/src/YGDialog.h (original) +++ trunk/gtk/src/YGDialog.h Wed Jul 14 12:40:53 2010 @@ -35,10 +35,11 @@ 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 blink(); + void present(); 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=62242&r1=62241&r2=62242&view=diff ============================================================================== --- trunk/gtk/src/YGPackageSelectorPluginStub.cc (original) +++ trunk/gtk/src/YGPackageSelectorPluginStub.cc Wed Jul 14 12:40:53 2010 @@ -11,6 +11,12 @@ #include <YEvent.h> #include <string.h> +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=62242&r1=62241&r2=62242&view=diff ============================================================================== --- trunk/gtk/src/YGUI.cc (original) +++ trunk/gtk/src/YGUI.cc Wed Jul 14 12:40:53 2010 @@ -118,7 +118,7 @@ const char *argp = argv[i]; if (argp[0] != '-') { if (!strcmp (argp, "sw_single") || !strcmp (argp, "online_update")) - m_swsingle = true; + YGUI::pkgSelectorSize (&m_default_width, &m_default_height); continue; } argp++; @@ -143,6 +143,7 @@ )); 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=62242&r1=62241&r2=62242&view=diff ============================================================================== --- trunk/gtk/src/YGUI.h (original) +++ trunk/gtk/src/YGUI.h Wed Jul 14 12:40:53 2010 @@ -63,17 +63,20 @@ static gboolean busy_timeout_cb (gpointer data); // window-related arguments - bool m_have_wm, m_no_border, m_fullscreen, m_swsingle; + bool m_have_wm, m_no_border, m_fullscreen; 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; } - bool isPkgSelector() const { return m_swsingle; } + int defaultHeight() const { return m_default_height; } }; // debug helpers. Modified: trunk/gtk/src/pkg/YGPackageSelector.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/YGPackageSelector.cc?rev=62242&r1=62241&r2=62242&view=diff ============================================================================== --- trunk/gtk/src/pkg/YGPackageSelector.cc (original) +++ trunk/gtk/src/pkg/YGPackageSelector.cc Wed Jul 14 12:40:53 2010 @@ -177,14 +177,10 @@ 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); - if (YGUtils::getCharsWidth (vpaned, 1) < 7) - gtk_paned_set_position (GTK_PANED (vpaned), 485); - else - gtk_paned_set_position (GTK_PANED (vpaned), 500); + gtk_paned_set_position (GTK_PANED (vpaned), 485); return vpaned; } @@ -197,10 +193,7 @@ GtkWidget *hpaned = gtk_hpaned_new(); gtk_paned_pack1 (GTK_PANED (hpaned), createSidebar(), FALSE, TRUE); gtk_paned_pack2 (GTK_PANED (hpaned), createMainArea(), TRUE, FALSE); - if (YGUtils::getCharsWidth (hpaned, 1) < 7) - gtk_paned_set_position (GTK_PANED (hpaned), 200); - else - gtk_paned_set_position (GTK_PANED (hpaned), 230); + gtk_paned_set_position (GTK_PANED (hpaned), 200); m_widget = gtk_vbox_new (FALSE, 6); gtk_box_pack_start (GTK_BOX (m_widget), hpaned, TRUE, TRUE, 0); @@ -584,8 +577,7 @@ static void vpaned_allocate_cb (GtkWidget *vpaned, GtkAllocation *alloc, Impl *pThis) { if (!g_object_get_data (G_OBJECT (vpaned), "init")) { // only once - int height = (YGUtils::getCharsWidth (vpaned, 1) < 7) ? 180 : 220; - int pos = MAX (alloc->height / 2, alloc->height - height); + int pos = MAX (alloc->height / 2, alloc->height - 180); gtk_paned_set_position (GTK_PANED (vpaned), pos); g_object_set_data (G_OBJECT (vpaned), "init", GINT_TO_POINTER (1)); } @@ -676,6 +668,9 @@ 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=62242&r1=62241&r2=62242&view=diff ============================================================================== --- trunk/gtk/src/pkg/ygtkpkgdetailview.cc (original) +++ trunk/gtk/src/pkg/ygtkpkgdetailview.cc Wed Jul 14 12:40:53 2010 @@ -339,16 +339,16 @@ ZyppPackage zpkg = castZyppPackage (zobj); std::string str; - std::string b ("<i>"), _b ("</i> "), i (""), _i(""), br ("<br/>"); + std::string b ("<i>"), _b ("</i> "), br ("<br/>"); str.reserve (2048); - str += b + _("Size:") + _b + i + zobj->installSize().asString() + _i; - str += br + b + _("License:") + _b + i + zpkg->license() + _i; + str += b + _("Size:") + _b + zobj->installSize().asString(); + str += br + b + _("License:") + _b + zpkg->license(); if (zsel->hasInstalledObj()) - str += br + b + ("Installed at:") + _b + i + - zsel->installedObj()->installtime().form ("%x") + _i; + str += br + b + ("Installed at:") + _b + + zsel->installedObj()->installtime().form ("%x"); if (zsel->hasCandidateObj()) - str += br + b + ("Latest build:") + _b + i + - zsel->candidateObj()->buildtime().form ("%x") + _i; + str += br + b + ("Latest build:") + _b + + zsel->candidateObj()->buildtime().form ("%x"); ygtk_rich_text_set_text (YGTK_RICH_TEXT (text), str.c_str()); } @@ -720,8 +720,6 @@ 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()); @@ -760,8 +758,10 @@ Ypp::Selectable sel = list.get (0); clear(); - std::string installed_str (_("<i>Installed Version</i>")); - std::string candidate_str (_("<i>Available Version</i>")); + 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>"; 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>Not specified.</i>")); + ygtk_rich_text_set_text (YGTK_RICH_TEXT (text), _("<i>Unspecified attribute.</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
participants (1)
-
rpmcruz@svn.opensuse.org