[Fedora-directory-commits] esc/src/app/xpcom/tray rhITray.idl, 1.2, 1.3 rhLinuxTray.cpp, 1.2, 1.3 rhMacTray.cpp, 1.2, 1.3 rhTray.cpp, 1.2, 1.3
Jack Magne (jmagne)
fedora-directory-commits at redhat.com
Wed Sep 27 17:22:01 UTC 2006
- Previous message (by thread): [Fedora-directory-commits] esc/rpm esc, NONE, 1.1 esc.desktop, NONE, 1.1 esc.spec, NONE, 1.1
- Next message (by thread): [Fedora-directory-commits] esc/src/app/xpcom Makefile.moz, 1.2, 1.3 rhCoolKey.cpp, 1.2, 1.3 rhICoolKey.idl, 1.2, 1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xpcom/tray
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26495
Modified Files:
rhITray.idl rhLinuxTray.cpp rhMacTray.cpp rhTray.cpp
Log Message:
Latest updates.
Index: rhITray.idl
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/rhITray.idl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- rhITray.idl 13 Sep 2006 17:50:07 -0000 1.2
+++ rhITray.idl 27 Sep 2006 17:21:58 -0000 1.3
@@ -24,6 +24,8 @@
void setwindnotifycallback(in rhITrayWindNotify jsNotify);
void unsetwindnotifycallback(in rhITrayWindNotify jsNotify);
+ void setmenuitemtext(in unsigned long aIndex, in string aText);
+
};
Index: rhLinuxTray.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/rhLinuxTray.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- rhLinuxTray.cpp 13 Sep 2006 17:50:07 -0000 1.2
+++ rhLinuxTray.cpp 27 Sep 2006 17:21:58 -0000 1.3
@@ -269,7 +269,6 @@
mInitialized = 1;
- notify_icon_hide();
return S_OK;
}
@@ -421,18 +420,21 @@
if(event->button == 1)
{
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::IconCBProc Clicked!\n"));
+
+ NotifyTrayWindListeners(MENU_EVT,MENU_SHOW);
rhTray::ShowAllListeners();
return;
-
-
}
-
- if(mIconMenu)
+ if(event->button == 2 || event->button == 3)
{
- g_print("trying to create popup menu. \n");
- gtk_menu_popup(GTK_MENU(mIconMenu),
+
+ if(mIconMenu)
+ {
+ g_print("trying to create popup menu. \n");
+ gtk_menu_popup(GTK_MENU(mIconMenu),
NULL,
NULL,
NULL,
@@ -440,7 +442,8 @@
event->button,
event->time);
- }
+ }
+ }
}
@@ -586,6 +589,52 @@
}
+/* void setmenuitemtext (in unsigned long aIndex, in string aText); */
+NS_IMETHODIMP rhTray::Setmenuitemtext(PRUint32 aIndex, const char *aText)
+{
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Setmenuitemtext: index: %d text %s. \n",aIndex,aText));
+
+ if(!aText)
+ return S_OK;
+
+ if(!mIconMenu)
+ return S_OK;
+
+ if(aIndex < 0 || aIndex > 10)
+ return S_OK;
+
+ GList *iterate = NULL;
+
+ GList* children = gtk_container_get_children (GTK_CONTAINER (mIconMenu));
+
+ unsigned int i = 0;
+ for (iterate = children; iterate; iterate=iterate->next)
+ {
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Setmenuitemtext: index: %d \n",i));
+ if(aIndex == i)
+ {
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Setmenuitemtext: About to reset text of item %p. \n",(void *) iterate->data));
+ if(iterate->data)
+ {
+ GtkWidget *label = gtk_bin_get_child(GTK_BIN(iterate->data));
+
+ if(label)
+ {
+
+ gtk_label_set_text(GTK_LABEL(label),aText);
+ }
+ }
+
+ break;
+ }
+
+ i++;
+ }
+
+ return S_OK;
+}
+
//rhTrayWindNotify methods
rhITrayWindNotify* rhTray::GetTrayWindNotifyListener(rhITrayWindNotify *listener)
@@ -719,15 +768,27 @@
return S_OK;
}
-
void rhTrayWindowListener::ShowWindow()
{
if(mWnd)
{
- gtk_widget_show(mWnd);
+ GtkWidget *widget = NULL;
+
+ widget = GTK_WIDGET(mWnd);
-
- gtk_window_deiconify(GTK_WINDOW(mWnd));
+ if(widget->window)
+ {
+ if(GTK_WIDGET_VISIBLE(mWnd))
+ {
+ gdk_window_show(widget->window);
+ gdk_window_raise(widget->window);
+
+ }
+ else
+ {
+ gtk_widget_show(widget);
+ }
+ }
PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: ShowWindow \n"));
}
Index: rhMacTray.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/rhMacTray.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- rhMacTray.cpp 13 Sep 2006 17:50:07 -0000 1.2
+++ rhMacTray.cpp 27 Sep 2006 17:21:58 -0000 1.3
@@ -503,6 +503,13 @@
}
+/* void setmenuitemtext (in unsigned long aIndex, in string aText); */
+NS_IMETHODIMP rhTray::Setmenuitemtext(PRUint32 aIndex, const char *aText)
+{
+ return S_OK;
+}
+
+
//rhTrayWindNotify methods
rhITrayWindNotify* rhTray::GetTrayWindNotifyListener(rhITrayWindNotify *listener)
Index: rhTray.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/rhTray.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- rhTray.cpp 13 Sep 2006 17:50:07 -0000 1.2
+++ rhTray.cpp 27 Sep 2006 17:21:58 -0000 1.3
@@ -641,6 +641,13 @@
}
+/* void setmenuitemtext (in unsigned long aIndex, in string aText); */
+NS_IMETHODIMP rhTray::Setmenuitemtext(PRUint32 aIndex, const char *aText)
+{
+ return S_OK;
+}
+
+
//rhTrayWindNotify methods
rhITrayWindNotify* rhTray::GetTrayWindNotifyListener(rhITrayWindNotify *listener)
- Previous message (by thread): [Fedora-directory-commits] esc/rpm esc, NONE, 1.1 esc.desktop, NONE, 1.1 esc.spec, NONE, 1.1
- Next message (by thread): [Fedora-directory-commits] esc/src/app/xpcom Makefile.moz, 1.2, 1.3 rhCoolKey.cpp, 1.2, 1.3 rhICoolKey.idl, 1.2, 1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Fedora-directory-commits
mailing list