ui: removed 'Save Project' and 'Save Project As' actions
* removed save actions from menu in QtMainWindow * removed MessageSaveProject and all Listeners * updated project loading to ask whether old project and db file should be kept at old location * fixed crash for missing include files * fixed simple header search within source paths was broken
This commit is contained in:
+43
-26
@@ -1,5 +1,6 @@
|
|||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
|
|
||||||
|
#include "utility/file/FileSystem.h"
|
||||||
#include "utility/logging/logging.h"
|
#include "utility/logging/logging.h"
|
||||||
#include "utility/messaging/MessageQueue.h"
|
#include "utility/messaging/MessageQueue.h"
|
||||||
#include "utility/messaging/type/MessageActivateNodes.h"
|
#include "utility/messaging/type/MessageActivateNodes.h"
|
||||||
@@ -201,18 +202,6 @@ void Application::refreshProject()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::saveProject(const FilePath& projectSettingsFilePath)
|
|
||||||
{
|
|
||||||
if (!m_project->save(projectSettingsFilePath))
|
|
||||||
{
|
|
||||||
LOG_ERROR("No Project Settings File defined");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MessageStatus("Project saved").dispatch();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Application::handleMessage(MessageActivateWindow* message)
|
void Application::handleMessage(MessageActivateWindow* message)
|
||||||
{
|
{
|
||||||
if (m_hasGUI)
|
if (m_hasGUI)
|
||||||
@@ -248,17 +237,50 @@ void Application::handleMessage(MessageLoadProject* message)
|
|||||||
{
|
{
|
||||||
if (m_hasGUI)
|
if (m_hasGUI)
|
||||||
{
|
{
|
||||||
std::vector<std::string> options;
|
FilePath path = projectSettingsFilePath;
|
||||||
options.push_back("Yes");
|
FilePath oldPath = m_project->getProjectSettingsFilePath();
|
||||||
options.push_back("No");
|
|
||||||
int result = m_mainView->confirm(
|
|
||||||
"Some settings were changed, the project needs to be fully reindexed. "
|
|
||||||
"Do you want to reindex the project?", options);
|
|
||||||
|
|
||||||
if (result == 1)
|
if (oldPath.exists() && oldPath != path)
|
||||||
{
|
{
|
||||||
m_project->load(projectSettingsFilePath);
|
std::vector<std::string> options;
|
||||||
return;
|
options.push_back("Yes");
|
||||||
|
options.push_back("No");
|
||||||
|
int result = m_mainView->confirm(
|
||||||
|
"You changed the project location. The project file (.coatiproject) and the database file (.coatidb) will "
|
||||||
|
"be moved to the new location. Do you want to keep a copy of the files in the previous location?"
|
||||||
|
, options);
|
||||||
|
|
||||||
|
FilePath dbPath = FilePath(path).replaceExtension("coatidb");
|
||||||
|
FilePath olddbPath = FilePath(oldPath).replaceExtension("coatidb");
|
||||||
|
|
||||||
|
m_project = Project::create(m_storageCache.get());
|
||||||
|
|
||||||
|
if (result == 0)
|
||||||
|
{
|
||||||
|
FileSystem::copyFile(olddbPath, dbPath);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FileSystem::remove(oldPath);
|
||||||
|
FileSystem::rename(olddbPath, dbPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::vector<std::string> options;
|
||||||
|
options.push_back("Yes");
|
||||||
|
options.push_back("No");
|
||||||
|
int result = m_mainView->confirm(
|
||||||
|
"Some settings were changed, the project needs to be fully reindexed. "
|
||||||
|
"Do you want to reindex the project?", options);
|
||||||
|
|
||||||
|
if (result == 1)
|
||||||
|
{
|
||||||
|
m_project->load(projectSettingsFilePath);
|
||||||
|
updateRecentProjects(projectSettingsFilePath);
|
||||||
|
m_mainView->setTitle("Coati - " + projectSettingsFilePath.fileName());
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -301,11 +323,6 @@ void Application::handleMessage(MessageRefresh* message)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::handleMessage(MessageSaveProject* message)
|
|
||||||
{
|
|
||||||
saveProject(message->projectSettingsFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Application::startMessagingAndScheduling()
|
void Application::startMessagingAndScheduling()
|
||||||
{
|
{
|
||||||
TaskScheduler::getInstance()->startSchedulerLoopThreaded();
|
TaskScheduler::getInstance()->startSchedulerLoopThreaded();
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
#include "utility/messaging/type/MessageFinishedParsing.h"
|
#include "utility/messaging/type/MessageFinishedParsing.h"
|
||||||
#include "utility/messaging/type/MessageLoadProject.h"
|
#include "utility/messaging/type/MessageLoadProject.h"
|
||||||
#include "utility/messaging/type/MessageRefresh.h"
|
#include "utility/messaging/type/MessageRefresh.h"
|
||||||
#include "utility/messaging/type/MessageSaveProject.h"
|
|
||||||
|
|
||||||
class IDECommunicationController;
|
class IDECommunicationController;
|
||||||
class NetworkFactory;
|
class NetworkFactory;
|
||||||
@@ -24,7 +23,6 @@ class Application
|
|||||||
, public MessageListener<MessageFinishedParsing>
|
, public MessageListener<MessageFinishedParsing>
|
||||||
, public MessageListener<MessageLoadProject>
|
, public MessageListener<MessageLoadProject>
|
||||||
, public MessageListener<MessageRefresh>
|
, public MessageListener<MessageRefresh>
|
||||||
, public MessageListener<MessageSaveProject>
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static std::shared_ptr<Application> create(const Version& version, ViewFactory* viewFactory, NetworkFactory* networkFactory);
|
static std::shared_ptr<Application> create(const Version& version, ViewFactory* viewFactory, NetworkFactory* networkFactory);
|
||||||
@@ -36,7 +34,6 @@ public:
|
|||||||
void createAndLoadProject(const FilePath& projectSettingsFilePath);
|
void createAndLoadProject(const FilePath& projectSettingsFilePath);
|
||||||
void loadProject(const FilePath& projectSettingsFilePath);
|
void loadProject(const FilePath& projectSettingsFilePath);
|
||||||
void refreshProject();
|
void refreshProject();
|
||||||
void saveProject(const FilePath& projectSettingsFilePath);
|
|
||||||
bool hasGUI();
|
bool hasGUI();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -46,7 +43,6 @@ private:
|
|||||||
virtual void handleMessage(MessageFinishedParsing* message);
|
virtual void handleMessage(MessageFinishedParsing* message);
|
||||||
virtual void handleMessage(MessageLoadProject* message);
|
virtual void handleMessage(MessageLoadProject* message);
|
||||||
virtual void handleMessage(MessageRefresh* message);
|
virtual void handleMessage(MessageRefresh* message);
|
||||||
virtual void handleMessage(MessageSaveProject* message);
|
|
||||||
|
|
||||||
void startMessagingAndScheduling();
|
void startMessagingAndScheduling();
|
||||||
|
|
||||||
|
|||||||
@@ -255,7 +255,6 @@ add_files(
|
|||||||
utility/messaging/type/MessageRedo.h
|
utility/messaging/type/MessageRedo.h
|
||||||
utility/messaging/type/MessageRefresh.h
|
utility/messaging/type/MessageRefresh.h
|
||||||
utility/messaging/type/MessageResetZoom.h
|
utility/messaging/type/MessageResetZoom.h
|
||||||
utility/messaging/type/MessageSaveProject.h
|
|
||||||
utility/messaging/type/MessageScrollCode.h
|
utility/messaging/type/MessageScrollCode.h
|
||||||
utility/messaging/type/MessageSearch.h
|
utility/messaging/type/MessageSearch.h
|
||||||
utility/messaging/type/MessageSearchAutocomplete.h
|
utility/messaging/type/MessageSearchAutocomplete.h
|
||||||
|
|||||||
+3
-35
@@ -91,36 +91,6 @@ Project::ProjectState Project::reload()
|
|||||||
return m_state;
|
return m_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Project::save(const FilePath& projectSettingsFile)
|
|
||||||
{
|
|
||||||
bool differentLocation = (projectSettingsFile != m_projectSettingsFilepath);
|
|
||||||
if (!projectSettingsFile.empty())
|
|
||||||
{
|
|
||||||
setProjectSettingsFilePath(projectSettingsFile);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
differentLocation = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_projectSettingsFilepath.empty())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
ProjectSettings settings;
|
|
||||||
settings.load(m_projectSettingsFilepath);
|
|
||||||
|
|
||||||
if (differentLocation || settings != *ProjectSettings::getInstance().get())
|
|
||||||
{
|
|
||||||
ProjectSettings::getInstance()->save(m_projectSettingsFilepath);
|
|
||||||
|
|
||||||
LOG_INFO_STREAM(<< "ProjectSettings saved to file: " << m_projectSettingsFilepath.str());
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Project::clearStorage()
|
void Project::clearStorage()
|
||||||
{
|
{
|
||||||
if (m_state == PROJECT_OUTVERSIONED)
|
if (m_state == PROJECT_OUTVERSIONED)
|
||||||
@@ -291,14 +261,12 @@ Parser::Arguments Project::getParserArguments() const
|
|||||||
if (projSettings->getUseSourcePathsForHeaderSearch())
|
if (projSettings->getUseSourcePathsForHeaderSearch())
|
||||||
{
|
{
|
||||||
std::vector<FilePath> headerSearchSubPaths;
|
std::vector<FilePath> headerSearchSubPaths;
|
||||||
for (FilePath p : projSettings->getAbsoluteHeaderSearchPaths())
|
for (FilePath p : projSettings->getSourcePaths())
|
||||||
{
|
{
|
||||||
std::vector<FilePath> tempPaths = FileSystem::getSubDirectories(p);
|
utility::append(headerSearchSubPaths, FileSystem::getSubDirectories(p));
|
||||||
headerSearchSubPaths.insert( headerSearchSubPaths.end(), tempPaths.begin(), tempPaths.end() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique(headerSearchSubPaths.begin(),headerSearchSubPaths.end());
|
utility::append(args.systemHeaderSearchPaths, utility::unique(headerSearchSubPaths));
|
||||||
utility::append(args.systemHeaderSearchPaths, headerSearchSubPaths);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
utility::append(args.frameworkSearchPaths, projSettings->getAbsoluteFrameworkSearchPaths());
|
utility::append(args.frameworkSearchPaths, projSettings->getAbsoluteFrameworkSearchPaths());
|
||||||
|
|||||||
@@ -31,8 +31,6 @@ public:
|
|||||||
ProjectState load(const FilePath& projectSettingsFile);
|
ProjectState load(const FilePath& projectSettingsFile);
|
||||||
ProjectState reload();
|
ProjectState reload();
|
||||||
|
|
||||||
bool save(const FilePath& projectSettingsFile);
|
|
||||||
|
|
||||||
void clearStorage();
|
void clearStorage();
|
||||||
|
|
||||||
void logStats() const;
|
void logStats() const;
|
||||||
|
|||||||
@@ -157,11 +157,6 @@ bool ProjectSettings::setSourceExtensions(const std::vector<std::string> &source
|
|||||||
return setValues("source/extensions/source_extensions", sourceExtensions);
|
return setValues("source/extensions/source_extensions", sourceExtensions);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProjectSettings::isUseSourcePathsForHeaderSearchDefined() const
|
|
||||||
{
|
|
||||||
return isValueDefined("source/use_source_paths_for_header_search");
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ProjectSettings::getUseSourcePathsForHeaderSearch() const
|
bool ProjectSettings::getUseSourcePathsForHeaderSearch() const
|
||||||
{
|
{
|
||||||
return getValue<bool>("source/use_source_paths_for_header_search", false);
|
return getValue<bool>("source/use_source_paths_for_header_search", false);
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ public:
|
|||||||
std::vector<std::string> getSourceExtensions() const;
|
std::vector<std::string> getSourceExtensions() const;
|
||||||
bool setSourceExtensions(const std::vector<std::string>& sourceExtensions);
|
bool setSourceExtensions(const std::vector<std::string>& sourceExtensions);
|
||||||
|
|
||||||
bool isUseSourcePathsForHeaderSearchDefined() const;
|
|
||||||
bool getUseSourcePathsForHeaderSearch() const;
|
bool getUseSourcePathsForHeaderSearch() const;
|
||||||
bool setUseSourcePathsForHeaderSearch(bool useSourcePathsForHeaderSearch);
|
bool setUseSourcePathsForHeaderSearch(bool useSourcePathsForHeaderSearch);
|
||||||
|
|
||||||
|
|||||||
@@ -116,14 +116,72 @@ std::string FileSystem::getTimeStringNow() // TODO: move to utility
|
|||||||
return boost::posix_time::to_iso_string(boost::posix_time::second_clock::universal_time());
|
return boost::posix_time::to_iso_string(boost::posix_time::second_clock::universal_time());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FileSystem::exists(const std::string& path)
|
bool FileSystem::exists(const FilePath& path)
|
||||||
{
|
{
|
||||||
return boost::filesystem::exists(boost::filesystem::path(path));
|
return boost::filesystem::exists(path.path());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FileSystem::remove(const std::string& path)
|
bool FileSystem::remove(const FilePath& path)
|
||||||
{
|
{
|
||||||
return boost::filesystem::remove(path);
|
return boost::filesystem::remove(path.path());
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FileSystem::rename(const FilePath& from, const FilePath& to)
|
||||||
|
{
|
||||||
|
if (!from.exists() || to.exists())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
boost::filesystem::rename(from.path(), to.path());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FileSystem::copyFile(const FilePath& from, const FilePath& to)
|
||||||
|
{
|
||||||
|
if (!from.exists() || to.exists())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
boost::filesystem::copy_file(boost::filesystem::path(from.path()), boost::filesystem::path(to.path()));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FileSystem::copy_directory(const FilePath& from, const FilePath& to)
|
||||||
|
{
|
||||||
|
if (!from.exists() || to.exists())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
boost::filesystem::copy_directory(boost::filesystem::path(from.path()),boost::filesystem::path(to.path()));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FileSystem::createDirectory(const FilePath& path)
|
||||||
|
{
|
||||||
|
boost::filesystem::create_directories(path.str());
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<FilePath> FileSystem::getSubDirectories(const FilePath &path)
|
||||||
|
{
|
||||||
|
std::vector<FilePath> v;
|
||||||
|
|
||||||
|
if (!path.exists())
|
||||||
|
{
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (boost::filesystem::recursive_directory_iterator end, dir(path.str()); dir != end; dir++)
|
||||||
|
{
|
||||||
|
if (boost::filesystem::is_directory(dir->path()))
|
||||||
|
{
|
||||||
|
v.push_back(FilePath(dir->path()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string FileSystem::fileName(const std::string& path)
|
std::string FileSystem::fileName(const std::string& path)
|
||||||
@@ -169,38 +227,3 @@ bool FileSystem::equivalent(const std::string& pathA, const std::string& pathB)
|
|||||||
|
|
||||||
return boost::filesystem::path(pathA).compare(boost::filesystem::path(pathB)) == 0;
|
return boost::filesystem::path(pathA).compare(boost::filesystem::path(pathB)) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileSystem::createDirectory(const FilePath& path)
|
|
||||||
{
|
|
||||||
boost::filesystem::create_directories(path.str());
|
|
||||||
}
|
|
||||||
|
|
||||||
bool FileSystem::copy_directory(const FilePath& from, const FilePath& to)
|
|
||||||
{
|
|
||||||
if(!from.exists() || to.exists())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
boost::filesystem::copy_directory(boost::filesystem::path(from.str()),boost::filesystem::path(to.str()));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<FilePath> FileSystem::getSubDirectories(const FilePath &path)
|
|
||||||
{
|
|
||||||
std::vector<FilePath> v;
|
|
||||||
|
|
||||||
if (!path.exists())
|
|
||||||
{
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (boost::filesystem::recursive_directory_iterator end, dir(path.str()); dir != end; dir++)
|
|
||||||
{
|
|
||||||
if (boost::filesystem::is_directory(dir->path()))
|
|
||||||
{
|
|
||||||
v.push_back(FilePath(dir->path()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -23,15 +23,18 @@ public:
|
|||||||
static TimePoint getLastWriteTime(const FilePath& filePath);
|
static TimePoint getLastWriteTime(const FilePath& filePath);
|
||||||
static std::string getTimeStringNow();
|
static std::string getTimeStringNow();
|
||||||
|
|
||||||
|
static bool exists(const FilePath& path);
|
||||||
|
static bool remove(const FilePath& path);
|
||||||
|
static bool rename(const FilePath& from, const FilePath& to);
|
||||||
|
|
||||||
|
static bool copyFile(const FilePath& from, const FilePath& to);
|
||||||
|
static bool copy_directory(const FilePath& from, const FilePath& to);
|
||||||
|
|
||||||
static void createDirectory(const FilePath& path);
|
static void createDirectory(const FilePath& path);
|
||||||
static std::vector<FilePath> getSubDirectories(const FilePath& path);
|
static std::vector<FilePath> getSubDirectories(const FilePath& path);
|
||||||
|
|
||||||
static bool exists(const std::string& path);
|
|
||||||
static std::string fileName(const std::string& path);
|
static std::string fileName(const std::string& path);
|
||||||
static std::string absoluteFilePath(const std::string& path);
|
static std::string absoluteFilePath(const std::string& path);
|
||||||
static bool remove(const std::string& path);
|
|
||||||
|
|
||||||
static bool copy_directory(const FilePath& from, const FilePath& to);
|
|
||||||
|
|
||||||
static std::string extension(const std::string& path);
|
static std::string extension(const std::string& path);
|
||||||
static std::string filePathWithoutExtension(const std::string& path);
|
static std::string filePathWithoutExtension(const std::string& path);
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
#ifndef MESSAGE_LOAD_PROJECT_H
|
#ifndef MESSAGE_LOAD_PROJECT_H
|
||||||
#define MESSAGE_LOAD_PROJECT_H
|
#define MESSAGE_LOAD_PROJECT_H
|
||||||
|
|
||||||
|
#include "utility/file/FilePath.h"
|
||||||
#include "utility/messaging/Message.h"
|
#include "utility/messaging/Message.h"
|
||||||
|
|
||||||
class MessageLoadProject: public Message<MessageLoadProject>
|
class MessageLoadProject
|
||||||
|
: public Message<MessageLoadProject>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MessageLoadProject(const std::string& filePath, bool forceRefresh)
|
MessageLoadProject(const FilePath& filePath, bool forceRefresh)
|
||||||
: projectSettingsFilePath(filePath)
|
: projectSettingsFilePath(filePath)
|
||||||
, forceRefresh(forceRefresh)
|
, forceRefresh(forceRefresh)
|
||||||
{
|
{
|
||||||
@@ -19,10 +21,10 @@ public:
|
|||||||
|
|
||||||
virtual void print(std::ostream& os) const
|
virtual void print(std::ostream& os) const
|
||||||
{
|
{
|
||||||
os << projectSettingsFilePath << ", forceRefresh: " << std::boolalpha << forceRefresh;
|
os << projectSettingsFilePath.str() << ", forceRefresh: " << std::boolalpha << forceRefresh;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string projectSettingsFilePath;
|
const FilePath projectSettingsFilePath;
|
||||||
const bool forceRefresh;
|
const bool forceRefresh;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
#ifndef MESSAGE_SAVE_PROJECT_H
|
|
||||||
#define MESSAGE_SAVE_PROJECT_H
|
|
||||||
|
|
||||||
#include "utility/messaging/Message.h"
|
|
||||||
|
|
||||||
class MessageSaveProject: public Message<MessageSaveProject>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
MessageSaveProject(const std::string& filePath)
|
|
||||||
: projectSettingsFilePath(filePath)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static const std::string getStaticType()
|
|
||||||
{
|
|
||||||
return "MessageSaveProject";
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void print(std::ostream& os) const
|
|
||||||
{
|
|
||||||
os << projectSettingsFilePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::string projectSettingsFilePath;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // MESSAGE_SAVE_PROJECT_H
|
|
||||||
@@ -30,7 +30,6 @@
|
|||||||
#include "utility/messaging/type/MessageRedo.h"
|
#include "utility/messaging/type/MessageRedo.h"
|
||||||
#include "utility/messaging/type/MessageRefresh.h"
|
#include "utility/messaging/type/MessageRefresh.h"
|
||||||
#include "utility/messaging/type/MessageResetZoom.h"
|
#include "utility/messaging/type/MessageResetZoom.h"
|
||||||
#include "utility/messaging/type/MessageSaveProject.h"
|
|
||||||
#include "utility/messaging/type/MessageSearch.h"
|
#include "utility/messaging/type/MessageSearch.h"
|
||||||
#include "utility/messaging/type/MessageSwitchColorScheme.h"
|
#include "utility/messaging/type/MessageSwitchColorScheme.h"
|
||||||
#include "utility/messaging/type/MessageUndo.h"
|
#include "utility/messaging/type/MessageUndo.h"
|
||||||
@@ -446,22 +445,6 @@ void QtMainWindow::forceRefresh()
|
|||||||
MessageRefresh().refreshAll().dispatch();
|
MessageRefresh().refreshAll().dispatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QtMainWindow::saveProject()
|
|
||||||
{
|
|
||||||
MessageSaveProject("").dispatch();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QtMainWindow::saveAsProject()
|
|
||||||
{
|
|
||||||
QString filename = "";
|
|
||||||
filename = QFileDialog::getSaveFileName(this, "Save File as", "", "Coati Project Files (*.coatiproject)");
|
|
||||||
|
|
||||||
if(!filename.isEmpty())
|
|
||||||
{
|
|
||||||
MessageSaveProject(filename.toStdString()).dispatch();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void QtMainWindow::undo()
|
void QtMainWindow::undo()
|
||||||
{
|
{
|
||||||
MessageUndo().dispatch();
|
MessageUndo().dispatch();
|
||||||
@@ -544,11 +527,6 @@ void QtMainWindow::setupProjectMenu()
|
|||||||
menu->addAction(tr("&Edit Project..."), this, SLOT(editProject()));
|
menu->addAction(tr("&Edit Project..."), this, SLOT(editProject()));
|
||||||
|
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
||||||
menu->addAction(tr("&Save Project"), this, SLOT(saveProject()), QKeySequence::Save);
|
|
||||||
menu->addAction(tr("Save Project as..."), this, SLOT(saveAsProject()), QKeySequence::SaveAs);
|
|
||||||
|
|
||||||
menu->addSeparator();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
menu->addAction(tr("E&xit"), QCoreApplication::instance(), SLOT(quit()), QKeySequence::Quit);
|
menu->addAction(tr("E&xit"), QCoreApplication::instance(), SLOT(quit()), QKeySequence::Quit);
|
||||||
|
|||||||
@@ -117,9 +117,6 @@ public slots:
|
|||||||
void refresh();
|
void refresh();
|
||||||
void forceRefresh();
|
void forceRefresh();
|
||||||
|
|
||||||
void saveProject();
|
|
||||||
void saveAsProject();
|
|
||||||
|
|
||||||
void undo();
|
void undo();
|
||||||
void redo();
|
void redo();
|
||||||
void zoomIn();
|
void zoomIn();
|
||||||
|
|||||||
@@ -555,8 +555,7 @@ void QtProjectWizzard::showSummary()
|
|||||||
|
|
||||||
void QtProjectWizzard::createProject()
|
void QtProjectWizzard::createProject()
|
||||||
{
|
{
|
||||||
std::string path = m_settings.getProjectFileLocation().str() + "/" + m_settings.getProjectName() + ".coatiproject";
|
FilePath path(m_settings.getProjectFileLocation().str() + "/" + m_settings.getProjectName() + ".coatiproject");
|
||||||
|
|
||||||
m_settings.save(path);
|
m_settings.save(path);
|
||||||
|
|
||||||
bool edited = false;
|
bool edited = false;
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ void PreprocessorCallbacks::InclusionDirective(
|
|||||||
clang::CharSourceRange fileNameRange, const clang::FileEntry* fileEntry, llvm::StringRef searchPath,
|
clang::CharSourceRange fileNameRange, const clang::FileEntry* fileEntry, llvm::StringRef searchPath,
|
||||||
llvm::StringRef relativePath, const clang::Module* imported
|
llvm::StringRef relativePath, const clang::Module* imported
|
||||||
){
|
){
|
||||||
if (!m_currentPath.empty())
|
if (!m_currentPath.empty() && fileEntry)
|
||||||
{
|
{
|
||||||
FilePath includedFilePath = FilePath(fileEntry->getName()).canonical();
|
FilePath includedFilePath = FilePath(fileEntry->getName()).canonical();
|
||||||
if (m_fileRegister->hasFilePath(includedFilePath))
|
if (m_fileRegister->hasFilePath(includedFilePath))
|
||||||
|
|||||||
@@ -878,20 +878,6 @@
|
|||||||
<li>Opens the <a href="#EditProjectWindow">Edit Project Window</a> prefilled with your project settings and allows for changing them.</li>
|
<li>Opens the <a href="#EditProjectWindow">Edit Project Window</a> prefilled with your project settings and allows for changing them.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
|
||||||
<strong>Save Project</strong>
|
|
||||||
<ul>
|
|
||||||
<li>Shortcut: <a href="#Shortcuts">Save Project</a></li>
|
|
||||||
<li>Save the project file.</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<strong>Save Project As</strong>
|
|
||||||
<ul>
|
|
||||||
<li>Shortcut: <a href="#"Shortcuts>Save Project As</a></li>
|
|
||||||
<li>Save the project file to another location. The project file will be duplicated.</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li>
|
<li>
|
||||||
<strong>Exit</strong>
|
<strong>Exit</strong>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -1074,18 +1060,6 @@
|
|||||||
<td><kbd>Cmd + O</kbd></td>
|
<td><kbd>Cmd + O</kbd></td>
|
||||||
<td><kbd>Ctrl + O</kbd></td>
|
<td><kbd>Ctrl + O</kbd></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<th scope="row">Save Project</th>
|
|
||||||
<td><kbd>Ctrl + S</kbd></td>
|
|
||||||
<td><kbd>Cmd + S</kbd></td>
|
|
||||||
<td><kbd>Ctrl + S</kbd></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th scope="row">Save Project As</th>
|
|
||||||
<td><kbd>Ctrl + Shift + S</kbd></td>
|
|
||||||
<td><kbd>Cmd + Shift + S</kbd></td>
|
|
||||||
<td><kbd>Ctrl + Shift + S</kbd></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Close Window</th>
|
<th scope="row">Close Window</th>
|
||||||
<td><kbd>Alt + F4</kbd></td>
|
<td><kbd>Alt + F4</kbd></td>
|
||||||
|
|||||||
Reference in New Issue
Block a user