Skip to content
Snippets Groups Projects
Commit 31100999 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

[j.0] minor cleanup in project context ()

Merging branch 'j.0'  into 'main'.

See merge request !2411
parents 298f921f 080b2253
No related branches found
No related tags found
1 merge request!2411minor cleanup in project context
Pipeline #133087 passed
......@@ -44,8 +44,6 @@ const char S_SAMPLE_3DVIEW_WIDGET_SIZE[] = "size";
const char S_PARAMETER_TUNING_WIDGET_COLUMN_WIDTH[] = "width";
const char S_INSTRUMENT_LIBRARY_EDITOR_TREE_WIDTH[] = "width";
const int MAX_RECENT_PROJECTS = 10;
// Hints
const unsigned int FIT_ACTIVITY_PANEL_WIDTH = 480;
......
......@@ -55,8 +55,7 @@ void AutosaveController::setDocument(ProjectDocument* document)
void AutosaveController::setAutosaveTime(int timerInterval)
{
m_timer->reset();
m_timer->setWallclockTimer(timerInterval);
m_timer->setTimerInterval(timerInterval);
}
//! Returns the name of autosave directory.
......
......@@ -18,7 +18,6 @@
#include "GUI/Model/Project/ProjectUtil.h"
#include "GUI/View/Info/MessageBox.h"
#include "GUI/View/Layout/ApplicationSettings.h"
#include "GUI/View/Layout/mainwindow_constants.h"
#include "GUI/View/Manager/AutosaveController.h"
#include "GUI/View/Manager/NewProjectDialog.h"
#include "GUI/View/Manager/ProjectLoadProblemDialog.h"
......@@ -148,13 +147,12 @@ void ProjectManager::clearRecentProjects()
//! Processes new project request (close old project, rise dialog for project name, create project).
ProjectDocument* ProjectManager::newProject()
void ProjectManager::newProject()
{
if (!closeCurrentProject())
return nullptr;
return;
createNewProject();
emit documentOpenedOrClosed(true);
return gDoc.get();
}
//! Processes close current project request. Call save/discard/cancel dialog, if necessary.
......@@ -325,7 +323,7 @@ void ProjectManager::addToRecentProjects()
QString fname = gDoc->projectFullPath();
m_recent_projects.removeAll(fname);
m_recent_projects.prepend(fname);
while (m_recent_projects.size() > GUI::Style::MAX_RECENT_PROJECTS)
while (m_recent_projects.size() > 10)
m_recent_projects.removeLast();
emit recentListModified();
......
......@@ -18,9 +18,6 @@
#include <QObject>
#include <QStringList>
class AutosaveController;
class ProjectDocument;
class AutosaveController;
//! Handles activity related to opening/save projects.
......@@ -51,7 +48,7 @@ signals:
public slots:
void setAutosaveEnabled(bool value);
void clearRecentProjects();
ProjectDocument* newProject();
void newProject();
bool closeCurrentProject();
bool saveProject(QString projectPullPath = "");
bool saveProjectAs();
......
......@@ -33,9 +33,10 @@ void UpdateTimer::reset()
m_is_busy = false;
}
void UpdateTimer::setWallclockTimer(int timerInterval)
void UpdateTimer::setTimerInterval(int t)
{
m_timer_interval = timerInterval;
reset();
m_timer_interval = t;
}
void UpdateTimer::scheduleUpdate()
......
......@@ -30,7 +30,7 @@ public:
void reset();
void setWallclockTimer(int timerInterval);
void setTimerInterval(int t);
signals:
void timeToUpdate();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment