Skip to content

Commit

Permalink
Replace BeIDE with Paladin if compiling on Haiku.
Browse files Browse the repository at this point in the history
  • Loading branch information
OscarL committed Mar 16, 2024
1 parent 9dfadcd commit 1922297
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Sources/CMenuItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ CMenuItem::CMenuItem(BMenu *subMenu)
{
sfBitmap = new BBitmap(BRect(0, 0, 15, 15), B_COLOR_8_BIT);

BMimeType mime("application/x-mw-BeIDE");
BMimeType mime(PE_DEFAULT_IDE_APPSIG);
mime.GetIcon(sfBitmap, B_MINI_ICON);
}
} /* CMenuItem::CMenuItem */
Expand Down
11 changes: 6 additions & 5 deletions Sources/PDoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ void PDoc::InitWindow(const char *name)
// add the BeIDE menu, if desired
if (showIde)
{
BMimeType mime("application/x-mw-BeIDE");
BMimeType mime(PE_DEFAULT_IDE_APPSIG);
if (mime.IsInstalled())
{
BMenu *menu = HResources::GetMenu(rid_Menu_DwBeide);
Expand Down Expand Up @@ -1886,8 +1886,9 @@ void PDoc::ShowRecentMenu(BPoint where, bool showalways)
void PDoc::IDEBringToFront()
{
entry_ref ide;
if (be_roster->FindApp("application/x-mw-BeIDE", &ide))
THROW(("BeIDE was not found"));

if (be_roster->FindApp(PE_DEFAULT_IDE_APPSIG, &ide))
THROW((PE_DEFAULT_IDE_NAME " was not found"));

if (be_roster->IsRunning(&ide))
be_roster->ActivateApp(be_roster->TeamFor(&ide));
Expand Down Expand Up @@ -1944,8 +1945,8 @@ void PDoc::IDEMake()
msg.AddData("target", PROPERTY_TYPE, &item, sizeof(item));

entry_ref ide;
if (be_roster->FindApp("application/x-mw-BeIDE", &ide))
THROW(("BeIDE was not found"));
if (be_roster->FindApp(PE_DEFAULT_IDE_APPSIG, &ide))
THROW((PE_DEFAULT_IDE_NAME " was not found"));

if (be_roster->IsRunning(&ide))
{
Expand Down
5 changes: 3 additions & 2 deletions Sources/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,9 @@ void OpenInTracker(const entry_ref& ref)
void SendToIDE(const BMessage& msg, BMessage *reply)
{
entry_ref ide;
if (be_roster->FindApp("application/x-mw-BeIDE", &ide))
THROW(("BeIDE was not found"));

if (be_roster->FindApp(PE_DEFAULT_IDE_APPSIG, &ide))
THROW((PE_DEFAULT_IDE_NAME " was not found"));

if (be_roster->IsRunning(&ide))
{
Expand Down
9 changes: 9 additions & 0 deletions Sources/pe.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,13 @@
#include <map>
#include <string>

#ifdef __HAIKU__
#define PE_DEFAULT_IDE_APPSIG "application/x-vnd.dw-Paladin"
#define PE_DEFAULT_IDE_NAME "Paladin"
#else
#define PE_DEFAULT_IDE_APPSIG "application/x-mw-BeIDE"
#define PE_DEFAULT_IDE_NAME "BeIDE"
#endif


#endif // PE_H

0 comments on commit 1922297

Please sign in to comment.