GUI updates

This commit is contained in:
Jim Norman 2005-10-12 22:47:25 +00:00
parent e216a450b9
commit 3e2465c1bf
4 changed files with 22 additions and 19 deletions

View File

@ -21,10 +21,11 @@ namespace Novell.CASA.GUI
public static System.Drawing.Icon m_iconNormal; public static System.Drawing.Icon m_iconNormal;
public static System.Drawing.Icon m_iconLocked; public static System.Drawing.Icon m_iconLocked;
#endif #endif
#if LINUX #if W32
EventBox eb; EventBox eb;
private Gtk.Image m_imageLocked = new Image("gtk-dialog-authentication", IconSize.Menu); private Gtk.Image m_imageLocked = new Image("gtk-dialog-authentication", IconSize.Menu);
private Gtk.Image m_imageUnlocked = new Image(Stock.MissingImage, IconSize.Menu); private Gtk.Image m_imageUnlocked = new Image(Stock.MissingImage, IconSize.Menu);
#endif #endif
private static CasaMain mCasaMain = null; private static CasaMain mCasaMain = null;
@ -37,7 +38,7 @@ namespace Novell.CASA.GUI
notifyIcon = new System.Windows.Forms.NotifyIcon(); notifyIcon = new System.Windows.Forms.NotifyIcon();
try try
{ {
s = File.OpenRead("../images/notify1.ico"); s = File.OpenRead("../images/CASAIcons.ico");
m_iconNormal = new System.Drawing.Icon(s); m_iconNormal = new System.Drawing.Icon(s);
notifyIcon.Icon = m_iconNormal; notifyIcon.Icon = m_iconNormal;
} }
@ -60,14 +61,14 @@ namespace Novell.CASA.GUI
try try
{ {
s = File.OpenRead("../images/notifyLocked.ico"); s = File.OpenRead("../images/CASAIconsLocked.ico");
m_iconLocked = new System.Drawing.Icon(s); m_iconLocked = new System.Drawing.Icon(s);
} }
catch (Exception e) catch (Exception e)
{ {
Console.WriteLine("File 'notifyLocked.ico' cannot be found"); Console.WriteLine("File 'CASAIcons.ico' cannot be found");
return; return;
} }
@ -81,13 +82,15 @@ namespace Novell.CASA.GUI
//notifyIcon.Click +=new EventHandler(notifyIcon_Click); //notifyIcon.Click +=new EventHandler(notifyIcon_Click);
notifyIcon.DoubleClick +=new EventHandler(notifyIcon_DoubleClick); notifyIcon.DoubleClick +=new EventHandler(notifyIcon_DoubleClick);
notifyIcon.MouseUp +=new System.Windows.Forms.MouseEventHandler(notifyIcon_MouseUp); notifyIcon.MouseUp +=new System.Windows.Forms.MouseEventHandler(notifyIcon_MouseUp);
notifyIcon.Text = "CASA Manager";
notifyIcon.Visible = true; notifyIcon.Visible = true;
UpdateTrayIcon(MiCASAStore.IsLocked());
#endif #endif
#if LINUX #if LINUX
/* in order to receive signals, we need a eventbox, because Gtk.Image doesn't receive signals */ /* in order to receive signals, we need a eventbox, because Gtk.Image doesn't receive signals */
eb = new EventBox(); eb = new EventBox();
eb.Add(m_iconNormal); // using stock icon eb.Add(); // using stock icon
// hooking event // hooking event
eb.ButtonPressEvent += new ButtonPressEventHandler (this.OnImageClick); eb.ButtonPressEvent += new ButtonPressEventHandler (this.OnImageClick);
@ -106,8 +109,8 @@ namespace Novell.CASA.GUI
MenuItem miSep2 = new MenuItem(); MenuItem miSep2 = new MenuItem();
MenuItem miSep3 = new MenuItem(); MenuItem miSep3 = new MenuItem();
ImageMenuItem menuLaunchGUI = new ImageMenuItem ("Launch CASAManager"); ImageMenuItem menuLaunchGUI = new ImageMenuItem ("Manage Secrets");
Image appimg = new Image(Stock.New, IconSize.Menu); Image appimg = new Image("../images/CASA_16.png", IconSize.Menu);
menuLaunchGUI.Image = appimg; // sets the menu item's image menuLaunchGUI.Image = appimg; // sets the menu item's image
menuLaunchGUI.Activated +=new EventHandler(menuLaunchGUI_Activated); menuLaunchGUI.Activated +=new EventHandler(menuLaunchGUI_Activated);
popupMenu.Add(menuLaunchGUI); popupMenu.Add(menuLaunchGUI);
@ -263,15 +266,15 @@ namespace Novell.CASA.GUI
{ {
#if W32 #if W32
if (StoreIsLocked) if (StoreIsLocked)
{
notifyIcon.Text = "miCASA - Locked";
notifyIcon.Icon = m_iconLocked; notifyIcon.Icon = m_iconLocked;
}
else else
{
notifyIcon.Text = "miCASA - Not Locked";
notifyIcon.Icon = m_iconNormal; notifyIcon.Icon = m_iconNormal;
#endif }
#if LINUX
if (StoreIsLocked)
eb.Reparent(m_imageLocked);
else
eb.Reparent(m_imageUnlocked);
#endif #endif
} }

BIN
c_gui/images/CASAicons.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -12,7 +12,7 @@
<property name="default_height">525</property> <property name="default_height">525</property>
<property name="resizable">True</property> <property name="resizable">True</property>
<property name="destroy_with_parent">True</property> <property name="destroy_with_parent">True</property>
<property name="icon">micasa-logo.png</property> <property name="icon">CASAicons.ico</property>
<property name="decorated">True</property> <property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property> <property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property> <property name="skip_pager_hint">False</property>
@ -708,7 +708,7 @@
<child> <child>
<widget class="GtkImage" id="image4"> <widget class="GtkImage" id="image4">
<property name="visible">True</property> <property name="visible">True</property>
<property name="pixbuf">micasa-logo.png</property> <property name="pixbuf">CASA_32.png</property>
<property name="xalign">0.5</property> <property name="xalign">0.5</property>
<property name="yalign">0.5</property> <property name="yalign">0.5</property>
<property name="xpad">0</property> <property name="xpad">0</property>
@ -2064,7 +2064,7 @@ their backend stores.</property>
<property name="default_height">600</property> <property name="default_height">600</property>
<property name="resizable">True</property> <property name="resizable">True</property>
<property name="destroy_with_parent">True</property> <property name="destroy_with_parent">True</property>
<property name="icon">micasa-logo.png</property> <property name="icon">CASAicons.ico</property>
<property name="decorated">True</property> <property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property> <property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property> <property name="skip_pager_hint">False</property>
@ -2717,7 +2717,7 @@ their backend stores.</property>
<child> <child>
<widget class="GtkImage" id="image1700"> <widget class="GtkImage" id="image1700">
<property name="visible">True</property> <property name="visible">True</property>
<property name="pixbuf">micasa-logo.png</property> <property name="pixbuf">CASA_32.png</property>
<property name="xalign">0.5</property> <property name="xalign">0.5</property>
<property name="yalign">0.5</property> <property name="yalign">0.5</property>
<property name="xpad">0</property> <property name="xpad">0</property>