Allow application signature as argument. If target has a replicant (e.g. ProcessController) give that precedence over desklink replicant.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21563 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
#include <List.h>
|
#include <List.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
|
#include <MimeType.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <PopUpMenu.h>
|
#include <PopUpMenu.h>
|
||||||
#include <Roster.h>
|
#include <Roster.h>
|
||||||
@@ -421,18 +422,30 @@ main(int, char **argv)
|
|||||||
atLeastOnePath = true;
|
atLeastOnePath = true;
|
||||||
|
|
||||||
BEntry entry(argv[i], true);
|
BEntry entry(argv[i], true);
|
||||||
if(!entry.Exists()) {
|
entry_ref ref;
|
||||||
|
|
||||||
|
if(entry.Exists()) {
|
||||||
|
entry.GetRef(&ref);
|
||||||
|
}
|
||||||
|
else if (BMimeType::IsValid(argv[i])) {
|
||||||
|
if (be_roster->FindApp(argv[i], &ref) != B_OK) {
|
||||||
|
printf("desklink: cannot find '%s'\n", argv[i]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
printf("desklink: cannot find '%s'\n", argv[i]);
|
printf("desklink: cannot find '%s'\n", argv[i]);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
entry_ref ref;
|
err = deskbar.AddItem(&ref);
|
||||||
entry.GetRef(&ref);
|
|
||||||
|
|
||||||
err = deskbar.AddItem(new DeskButton(BRect(0, 0, 15, 15),
|
|
||||||
&ref, "DeskButton", titleList, actionList));
|
|
||||||
if (err != B_OK) {
|
if (err != B_OK) {
|
||||||
printf("desklink: Deskbar refuses link to '%s': %s\n", argv[i], strerror(err));
|
err = deskbar.AddItem(new DeskButton(BRect(0, 0, 15, 15),
|
||||||
|
&ref, "DeskButton", titleList, actionList));
|
||||||
|
if (err != B_OK) {
|
||||||
|
printf("desklink: Deskbar refuses link to '%s': %s\n", argv[i], strerror(err));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
titleList.MakeEmpty();
|
titleList.MakeEmpty();
|
||||||
@@ -440,7 +453,7 @@ main(int, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!atLeastOnePath) {
|
if (!atLeastOnePath) {
|
||||||
printf( "usage: desklink { [ --list|--remove|[cmd=title:action ... ] path ] } ...\n"
|
printf( "usage: desklink { [ --list|--remove|[cmd=title:action ... ] [ path|signature ] } ...\n"
|
||||||
"--list: list all Deskbar addons.\n"
|
"--list: list all Deskbar addons.\n"
|
||||||
"--remove: delete all desklink addons.\n");
|
"--remove: delete all desklink addons.\n");
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user