[haiku-commits] r35805 - haiku/trunk/src/apps/deskbar

  • From: jonas@xxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 10 Mar 2010 23:25:01 +0100 (CET)

Author: kirilla
Date: 2010-03-10 23:25:01 +0100 (Wed, 10 Mar 2010)
New Revision: 35805
Changeset: http://dev.haiku-os.org/changeset/35805/haiku

Modified:
   haiku/trunk/src/apps/deskbar/BarApp.cpp
   haiku/trunk/src/apps/deskbar/BarApp.h
   haiku/trunk/src/apps/deskbar/BeMenu.cpp
Log:
Adding menu item Restart Tracker, to be shown when Tracker isn't running.

Modified: haiku/trunk/src/apps/deskbar/BarApp.cpp
===================================================================
--- haiku/trunk/src/apps/deskbar/BarApp.cpp     2010-03-10 19:20:20 UTC (rev 
35804)
+++ haiku/trunk/src/apps/deskbar/BarApp.cpp     2010-03-10 22:25:01 UTC (rev 
35805)
@@ -507,6 +507,13 @@
                        run_be_about();
                        break;
 
+               case kRestartTracker:
+               {
+                       BRoster roster;
+                       roster.Launch(kTrackerSignature);
+                       break;
+               }
+
                default:
                        BApplication::MessageReceived(message);
                        break;

Modified: haiku/trunk/src/apps/deskbar/BarApp.h
===================================================================
--- haiku/trunk/src/apps/deskbar/BarApp.h       2010-03-10 19:20:20 UTC (rev 
35804)
+++ haiku/trunk/src/apps/deskbar/BarApp.h       2010-03-10 22:25:01 UTC (rev 
35805)
@@ -79,6 +79,7 @@
 const uint32 kSuperExpando = 'SprE';
 const uint32 kExpandNewTeams = 'ExTm';
 const uint32 kAutoRaise = 'AtRs';
+const uint32 kRestartTracker = 'TRAK';
 
 // from roster_private.h
 const uint32 kShutdownSystem = 301;

Modified: haiku/trunk/src/apps/deskbar/BeMenu.cpp
===================================================================
--- haiku/trunk/src/apps/deskbar/BeMenu.cpp     2010-03-10 19:20:20 UTC (rev 
35804)
+++ haiku/trunk/src/apps/deskbar/BeMenu.cpp     2010-03-10 22:25:01 UTC (rev 
35805)
@@ -48,6 +48,7 @@
 #include "PublicCommands.h"
 #include "RecentItems.h"
 #include "StatusView.h"
+#include "tracker_private.h"
 
 #define ROSTER_SIG "application/x-vnd.Be-ROST"
 
@@ -222,7 +223,15 @@
        if (fBarView)
                dragging = fBarView->Dragging();
 
-       BMenuItem* item = new BMenuItem(
+       BMenuItem* item;
+       BRoster roster;
+       if (!roster.IsRunning(kTrackerSignature)) {
+               item = new BMenuItem("Restart Tracker", new 
BMessage(kRestartTracker));
+               AddItem(item);
+               AddSeparatorItem();
+       }
+
+       item = new BMenuItem(
 #ifdef HAIKU_DISTRO_COMPATIBILITY_OFFICIAL
        "About Haiku"
 #else


Other related posts: