Skip to content

Commit

Permalink
show project options when clicking on .Rproj file for current project
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Oct 21, 2011
1 parent c4624aa commit 1518a76
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
9 changes: 2 additions & 7 deletions src/cpp/desktop/DesktopMain.cpp
Expand Up @@ -13,14 +13,9 @@

// TODO: test on other platforms

// TODO: open -a RStudio on the Mac

// TODO: no longer possible for projects to come in through file
// associations. nix that codepath
// TODO: make sure file assocs still open in existing (.R)

// TODO: click on project self should open options

// TODO: consider whether .Rdata should also not re-activate existing
// TODO: open -a RStudio on the Mac

#include <QtGui>
#include <QtWebKit>
Expand Down
Expand Up @@ -122,18 +122,15 @@ void openFile(String filePath)
if (file.isDirectory())
return;

// special handling for open an Rproject on top of an
// an existing session
// this used to be possible but shouldn't be anymore
// (since we screen out .rproj from calling sendMessage
// within DesktopMain.cpp
if (file.getExtension().equalsIgnoreCase(".rproj"))
{
events_.fireEvent(new OpenProjectFileEvent(file));
}
else
{
// open the file. pass false for second param to prevent
// the default handler (the browser) from taking it
fileTypeRegistry_.openFile(file, false);
}
return;

// open the file. pass false for second param to prevent
// the default handler (the browser) from taking it
fileTypeRegistry_.openFile(file, false);
}

void quitR()
Expand Down
5 changes: 4 additions & 1 deletion src/gwt/src/org/rstudio/studio/client/projects/Projects.java
Expand Up @@ -407,11 +407,14 @@ public void onSuccess()
@Override
public void onOpenProjectFile(final OpenProjectFileEvent event)
{
// no-op for current project
// project options for current project
FileSystemItem projFile = event.getFile();
if (projFile.getPath().equals(
session_.getSessionInfo().getActiveProjectFile()))
{
onProjectOptions();
return;
}

// prompt to confirm
String projectPath = projFile.getParentPathString();
Expand Down

0 comments on commit 1518a76

Please sign in to comment.