Mailinglist Archive: yast-commit (590 mails)

< Previous Next >
[yast-commit] r61701 - in /trunk/gtk: ChangeLog package/yast2-gtk.changes src/pkg/ygtkpkghistorydialog.cc src/pkg/ygtkpkghistorydialog.h src/pkg/ygtkpkgmenubar.cc src/pkg/ygtkpkgundolist.cc
  • From: rpmcruz@xxxxxxxxxxxxxxxx
  • Date: Wed, 14 Apr 2010 11:35:47 -0000
  • Message-id: <E1O20sm-00025l-40@xxxxxxxxxxxxxxxx>
Author: rpmcruz
Date: Wed Apr 14 13:35:47 2010
New Revision: 61701

URL: http://svn.opensuse.org/viewcvs/yast?rev=61701&view=rev
Log:
* src/pkg/ygtkpkghistorydialog.h/cc: cache dialog,
and (at first use) improved visual feedback.

Modified:
trunk/gtk/ChangeLog
trunk/gtk/package/yast2-gtk.changes
trunk/gtk/src/pkg/ygtkpkghistorydialog.cc
trunk/gtk/src/pkg/ygtkpkghistorydialog.h
trunk/gtk/src/pkg/ygtkpkgmenubar.cc
trunk/gtk/src/pkg/ygtkpkgundolist.cc

Modified: trunk/gtk/ChangeLog
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/ChangeLog?rev=61701&r1=61700&r2=61701&view=diff
==============================================================================
--- trunk/gtk/ChangeLog (original)
+++ trunk/gtk/ChangeLog Wed Apr 14 13:35:47 2010
@@ -1,3 +1,8 @@
+2010-04-14 Ricardo Cruz <rpmcruz@xxxxxxxxxxxxxxxxxxx>
+
+ * src/pkg/ygtkpkghistorydialog.h/cc: cache dialog,
+ and (at first use) improved visual feedback.
+
2010-04-11 Ricardo Cruz <rpmcruz@xxxxxxxxxxxxxxxxxxx>

* src/pkg/ygtkpkghistorydialog.cc: set go-to entry

Modified: trunk/gtk/package/yast2-gtk.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/package/yast2-gtk.changes?rev=61701&r1=61700&r2=61701&view=diff
==============================================================================
--- trunk/gtk/package/yast2-gtk.changes (original)
+++ trunk/gtk/package/yast2-gtk.changes Wed Apr 14 13:35:47 2010
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Wed Apr 14 12:32:00 WET 2010 - rpmcruz@xxxxxxxxxxxxxxxxxxx
+
+- 2.21.37
+- sw_single: added visual feedback that history dialog may
+take a bit to load, and cached it for repetitive use.
+
+-------------------------------------------------------------------
Sun Apr 11 14:42:00 WET 2010 - rpmcruz@xxxxxxxxxxxxxxxxxxx

- 2.21.36

Modified: trunk/gtk/src/pkg/ygtkpkghistorydialog.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkghistorydialog.cc?rev=61701&r1=61700&r2=61701&view=diff
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkghistorydialog.cc (original)
+++ trunk/gtk/src/pkg/ygtkpkghistorydialog.cc Wed Apr 14 13:35:47 2010
@@ -341,7 +341,7 @@
g_free (shortcut);

GtkWidget *dialog = gtk_widget_get_toplevel (GTK_WIDGET
(log_view));
- gtk_widget_destroy (dialog);
+ gtk_widget_hide (dialog);
}
}

@@ -403,7 +403,7 @@
switch (response) {
case 1: goto_clicked (log_view); break;
case 2: save_to_file (GTK_WINDOW (dialog)); break;
- default: gtk_widget_destroy (GTK_WIDGET (dialog)); break;
+ default: gtk_widget_hide (GTK_WIDGET (dialog)); break;
}
}

@@ -507,14 +507,10 @@

YGtkPkgHistoryDialog::YGtkPkgHistoryDialog()
{
- ListHandler handler;
- ZyppHistoryParser parser (&handler);
-
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;

GtkWidget *log_view = ygtk_tree_view_new();
- gtk_tree_view_set_model (GTK_TREE_VIEW (log_view),
handler.log_handler->getModel());
gtk_tree_view_set_search_column (GTK_TREE_VIEW (log_view),
LogListHandler::SHORTCUT_COLUMN);
gtk_tree_view_set_fixed_height_mode (GTK_TREE_VIEW (log_view), TRUE);
gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (log_view), TRUE);
@@ -579,7 +575,7 @@
GTK_SCROLLED_WINDOW (log_scroll), GTK_SHADOW_IN);
gtk_container_add (GTK_CONTAINER (log_scroll), log_view);

- GtkWidget *date_view = gtk_tree_view_new_with_model
(handler.date_handler->getModel());
+ GtkWidget *date_view = gtk_tree_view_new();
gtk_tree_view_set_search_column (GTK_TREE_VIEW (date_view),
DateListHandler::TEXT_COLUMN);
gtk_tree_view_set_fixed_height_mode (GTK_TREE_VIEW (date_view), TRUE);

@@ -596,10 +592,9 @@
GTK_SCROLLED_WINDOW (date_scroll), GTK_SHADOW_IN);
gtk_container_add (GTK_CONTAINER (date_scroll), date_view);

- std::string title (_("History of Changes"));
- title += " ("; title += FILENAME; title += ")";
GtkWidget *dialog = gtk_message_dialog_new (YGDialog::currentWindow(),
- GtkDialogFlags (0), GTK_MESSAGE_OTHER, GTK_BUTTONS_NONE,
title.c_str());
+ GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_OTHER,
GTK_BUTTONS_NONE,
+ _("History of Changes (%s)"), FILENAME);
gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_JUMP_TO, 1);
gtk_dialog_add_button (GTK_DIALOG (dialog), _("Save to File"), 2);
gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CLOSE,
GTK_RESPONSE_CLOSE);
@@ -629,10 +624,31 @@
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (date_view));
g_signal_connect (G_OBJECT (selection), "changed",
G_CALLBACK (date_selection_changed_cb), log_view);
+
+ GdkDisplay *display = gtk_widget_get_display (dialog);
+ GdkCursor *cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
+ gdk_window_set_cursor (gtk_widget_get_window (dialog), cursor);
+ while (g_main_context_iteration (NULL, FALSE)) ;
+ gdk_cursor_unref (cursor);
+
+ ListHandler handler;
+ ZyppHistoryParser parser (&handler);
+ gtk_tree_view_set_model (GTK_TREE_VIEW (date_view),
handler.date_handler->getModel());
+ gtk_tree_view_set_model (GTK_TREE_VIEW (log_view),
handler.log_handler->getModel());
+
+ gdk_window_set_cursor (dialog->window, NULL);
}

YGtkPkgHistoryDialog::~YGtkPkgHistoryDialog() {}

void YGtkPkgHistoryDialog::popup()
-{ gtk_widget_show (m_dialog); }
+{ gtk_window_present (GTK_WINDOW (m_dialog)); }
+
+void popupHistoryDialog()
+{
+ static YGtkPkgHistoryDialog *dialog = 0;
+ if (!dialog)
+ dialog = new YGtkPkgHistoryDialog();
+ dialog->popup();
+}


Modified: trunk/gtk/src/pkg/ygtkpkghistorydialog.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkghistorydialog.h?rev=61701&r1=61700&r2=61701&view=diff
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkghistorydialog.h (original)
+++ trunk/gtk/src/pkg/ygtkpkghistorydialog.h Wed Apr 14 13:35:47 2010
@@ -22,5 +22,8 @@
GtkWidget *m_dialog;
};

+// use this method to create the dialog -- so it is cached
+void popupHistoryDialog();
+
#endif


Modified: trunk/gtk/src/pkg/ygtkpkgmenubar.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgmenubar.cc?rev=61701&r1=61700&r2=61701&view=diff
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgmenubar.cc (original)
+++ trunk/gtk/src/pkg/ygtkpkgmenubar.cc Wed Apr 14 13:35:47 2010
@@ -528,10 +528,7 @@
#include "ygtkpkghistorydialog.h"

static void show_log_changes_cb()
-{
- YGtkPkgHistoryDialog dialog;
- dialog.popup();
-}
+{ popupHistoryDialog(); }

static void reset_ignored_dependency_conflicts_cb()
{ zypp::getZYpp()->resolver()->undo(); }

Modified: trunk/gtk/src/pkg/ygtkpkgundolist.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgundolist.cc?rev=61701&r1=61700&r2=61701&view=diff
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgundolist.cc (original)
+++ trunk/gtk/src/pkg/ygtkpkgundolist.cc Wed Apr 14 13:35:47 2010
@@ -282,10 +282,8 @@
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), vbox);

int ret = gtk_dialog_run (GTK_DIALOG (dialog));
- if (ret == 1) {
- YGtkPkgHistoryDialog dialog;
- dialog.popup();
- }
+ if (ret == 1)
+ popupHistoryDialog();
gtk_widget_destroy (dialog);
return ret == GTK_RESPONSE_YES;
}

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages