Mailinglist Archive: yast-commit (590 mails)

< Previous Next >
[yast-commit] r61650 - in /trunk/gtk: ChangeLog src/YGTable.cc
  • From: rpmcruz@xxxxxxxxxxxxxxxx
  • Date: Sat, 10 Apr 2010 21:08:28 -0000
  • Message-id: <E1O0hum-0001JS-QV@xxxxxxxxxxxxxxxx>
Author: rpmcruz
Date: Sat Apr 10 23:08:28 2010
New Revision: 61650

URL: http://svn.opensuse.org/viewcvs/yast?rev=61650&view=rev
Log:
* src/YGTable.cc: don't show context menu entries
that aren't working.

Modified:
trunk/gtk/ChangeLog
trunk/gtk/src/YGTable.cc

Modified: trunk/gtk/ChangeLog
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/ChangeLog?rev=61650&r1=61649&r2=61650&view=diff
==============================================================================
--- trunk/gtk/ChangeLog (original)
+++ trunk/gtk/ChangeLog Sat Apr 10 23:08:28 2010
@@ -1,5 +1,10 @@
2010-04-10 Ricardo Cruz <rpmcruz@xxxxxxxxxxxxxxxxxxx>

+ * src/YGTable.cc: don't show context menu entries
+ that aren't working.
+
+2010-04-10 Ricardo Cruz <rpmcruz@xxxxxxxxxxxxxxxxxxx>
+
* src/pkg/ygtkpkghistorydialog.cc: re-worked the log
text as a list, making each item clickable
so user can easily see package details, and added

Modified: trunk/gtk/src/YGTable.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGTable.cc?rev=61650&r1=61649&r2=61650&view=diff
==============================================================================
--- trunk/gtk/src/YGTable.cc (original)
+++ trunk/gtk/src/YGTable.cc Sat Apr 10 23:08:28 2010
@@ -361,38 +361,40 @@

static void hack_right_click_cb (YGtkTreeView *view, gboolean outreach,
YGTable *pThis)
{
+ struct inner {
+ static void key_activate_cb (GtkMenuItem *item, YWidget
*button)
+ { activateButton (button); }
+ static void appendItem (GtkWidget *menu, const gchar
*stock, int key)
+ {
+ YWidget *button =
YGDialog::currentDialog()->getFunctionWidget (key);
+ if (button) {
+ GtkWidget *item;
+ item =
gtk_image_menu_item_new_from_stock (stock, NULL);
+ gtk_menu_shell_append (GTK_MENU_SHELL
(menu), item);
+ g_signal_connect (G_OBJECT (item),
"activate",
+
G_CALLBACK (key_activate_cb), button);
+ }
+ }
+ };
+
#if YAST2_VERSION > 2018003
if (pThis->notifyContextMenu())
return YGTableView::right_click_cb (view, outreach,
pThis);
#endif
GtkWidget *menu = gtk_menu_new();

- if (!YGDialog::currentDialog()->getFunctionWidget (5) ||
- YGDialog::currentDialog()->getClassWidgets
("YTable").size() > 1)
- // more than one table exists, or no function key 5
assigned
- gtk_widget_error_bell (GTK_WIDGET (view));
- else {
- struct inner {
- static void key_activate_cb (GtkMenuItem *item,
YWidget *button)
- { activateButton (button); }
- static void appendItem (GtkWidget *menu, const
gchar *stock, int key)
- {
- YWidget *button =
YGDialog::currentDialog()->getFunctionWidget (key);
- if (button) {
- GtkWidget *item;
- item =
gtk_image_menu_item_new_from_stock (stock, NULL);
- gtk_menu_shell_append
(GTK_MENU_SHELL (menu), item);
- g_signal_connect (G_OBJECT
(item), "activate",
-
G_CALLBACK (key_activate_cb), button);
- }
- }
- };
-
- if (outreach)
- inner::appendItem (menu, GTK_STOCK_ADD, 3);
+ YGDialog *dialog = YGDialog::currentDialog();
+ if (dialog->getClassWidgets ("YTable").size() == 1) {
+ // if more than one table exists, function keys become
ambiguous
+ if (outreach) {
+ if (dialog->getFunctionWidget(3))
+ inner::appendItem (menu, GTK_STOCK_ADD,
3);
+ }
else {
- inner::appendItem (menu, GTK_STOCK_EDIT, 4);
- inner::appendItem (menu, GTK_STOCK_DELETE, 5);
+ if (dialog->getFunctionWidget(4))
+ inner::appendItem (menu,
GTK_STOCK_EDIT, 4);
+ if (dialog->getFunctionWidget(5))
+ inner::appendItem (menu,
GTK_STOCK_DELETE, 5);
}
}


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

< Previous Next >
This Thread
  • No further messages