diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-02-01 18:45:59 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-02-01 18:45:59 (GMT) |
| commit | 038da72c61ea6a251d805e2de3662f240da52b02 (patch) | |
| tree | 05170050b16f9d663ec44ae451211e686ba196ac /src/Misc.cpp | |
| parent | 857b0cc1fc58f066acd59404d16ee5e566e20f00 (diff) | |
| download | powder-038da72c61ea6a251d805e2de3662f240da52b02.zip powder-038da72c61ea6a251d805e2de3662f240da52b02.tar.gz | |
Console UI, open in browser button, tab and enter shortcut for Login UI, various
Diffstat (limited to 'src/Misc.cpp')
| -rw-r--r-- | src/Misc.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/Misc.cpp b/src/Misc.cpp index a6ac711..1e73574 100644 --- a/src/Misc.cpp +++ b/src/Misc.cpp @@ -621,6 +621,29 @@ void HSV_to_RGB(int h,int s,int v,int *r,int *g,int *b)//convert 0-255(0-360 for *b += m; } +void OpenURI(std::string uri) { +#ifdef WIN32 + ShellExecute(0, "OPEN", uri.c_str(), NULL, NULL, 0); +#elif MACOSX + char *cmd = malloc(7+uri.length()); + strcpy(cmd, "open "); + strappend(cmd, uri.c_str()); + system(cmd); +#elif LIN32 + char *cmd = malloc(11+uri.length()); + strcpy(cmd, "xdg-open "); + strappend(cmd, uri.c_str()); + system(cmd); +#elif LIN64 + char *cmd = malloc(11+uri.length()); + strcpy(cmd, "xdg-open "); + strappend(cmd, uri.c_str()); + system(cmd); +#else + printf("Cannot open browser\n"); +#endif +} + void RGB_to_HSV(int r,int g,int b,int *h,int *s,int *v)//convert 0-255 RGB values to 0-255(0-360 for H) HSV { float rr, gg, bb, a,x,c,d; |
