Restore on start; open session and view settings, or start fresh

This commit is contained in:
Bruno Herbelin
2023-04-12 20:00:19 +02:00
parent 8104050658
commit 3ff193f42d
3 changed files with 11 additions and 9 deletions

View File

@@ -78,14 +78,16 @@ Mixer::Mixer() : session_(nullptr), back_session_(nullptr), sessionSwapRequested
if ( Settings::application.recentSessions.load_at_start && if ( Settings::application.recentSessions.load_at_start &&
Settings::application.recentSessions.front_is_valid && Settings::application.recentSessions.front_is_valid &&
Settings::application.recentSessions.filenames.size() > 0 && Settings::application.recentSessions.filenames.size() > 0 &&
Settings::application.fresh_start) Settings::application.fresh_start) {
load( Settings::application.recentSessions.filenames.front() ); load( Settings::application.recentSessions.filenames.front() );
else // initialize with the current view
// initializes with a new empty session
clear();
// this initializes with the current view
setView( (View::Mode) Settings::application.current_view ); setView( (View::Mode) Settings::application.current_view );
}
else {
// initialize with a new empty session
clear();
setView( View::MIXING );
}
} }
void Mixer::update() void Mixer::update()

View File

@@ -2682,7 +2682,7 @@ void SourceController::Render()
// offer to open folder location // offer to open folder location
ImVec2 draw_pos = ImGui::GetCursorPos(); ImVec2 draw_pos = ImGui::GetCursorPos();
ImGui::SetCursorPos(draw_pos + ImVec2(ImGui::GetContentRegionAvailWidth() - 1.2 * ImGui::GetTextLineHeightWithSpacing(), -ImGui::GetFrameHeight()) ); ImGui::SetCursorPos(draw_pos + ImVec2(ImGui::GetContentRegionAvailWidth() - 1.2 * ImGui::GetTextLineHeightWithSpacing(), -ImGui::GetFrameHeight()) );
if (ImGuiToolkit::IconButton( ICON_FA_EXTERNAL_LINK_ALT, Settings::application.source.capture_path.c_str())) if (ImGuiToolkit::IconButton( ICON_FA_FOLDER_OPEN, Settings::application.source.capture_path.c_str()))
SystemToolkit::open(Settings::application.source.capture_path); SystemToolkit::open(Settings::application.source.capture_path);
ImGui::SetCursorPos(draw_pos); ImGui::SetCursorPos(draw_pos);
@@ -4476,7 +4476,7 @@ void OutputPreview::Render()
// offer to open folder location // offer to open folder location
ImVec2 draw_pos = ImGui::GetCursorPos(); ImVec2 draw_pos = ImGui::GetCursorPos();
ImGui::SetCursorPos(draw_pos + ImVec2(ImGui::GetContentRegionAvailWidth() - 1.2 * ImGui::GetTextLineHeightWithSpacing(), -ImGui::GetFrameHeight()) ); ImGui::SetCursorPos(draw_pos + ImVec2(ImGui::GetContentRegionAvailWidth() - 1.2 * ImGui::GetTextLineHeightWithSpacing(), -ImGui::GetFrameHeight()) );
if (ImGuiToolkit::IconButton( ICON_FA_EXTERNAL_LINK_ALT, Settings::application.record.path.c_str())) if (ImGuiToolkit::IconButton( ICON_FA_FOLDER_OPEN, Settings::application.record.path.c_str()))
SystemToolkit::open(Settings::application.record.path); SystemToolkit::open(Settings::application.record.path);
ImGui::SetCursorPos(draw_pos); ImGui::SetCursorPos(draw_pos);

View File

@@ -42,7 +42,7 @@
#define SHORTCUT_SAVE_FILE CTRL_MOD "S" #define SHORTCUT_SAVE_FILE CTRL_MOD "S"
#define MENU_SAVEAS_FILE ICON_FA_FILE_DOWNLOAD " Save as" #define MENU_SAVEAS_FILE ICON_FA_FILE_DOWNLOAD " Save as"
#define MENU_SAVE_ON_EXIT ICON_FA_LEVEL_DOWN_ALT " Save on exit" #define MENU_SAVE_ON_EXIT ICON_FA_LEVEL_DOWN_ALT " Save on exit"
#define MENU_OPEN_ON_START ICON_FA_LEVEL_UP_ALT " Open last on start" #define MENU_OPEN_ON_START ICON_FA_LEVEL_UP_ALT " Restore on start"
#define SHORTCUT_SAVEAS_FILE CTRL_MOD "Shift+S" #define SHORTCUT_SAVEAS_FILE CTRL_MOD "Shift+S"
#define SHORTCUT_LOGS CTRL_MOD "L" #define SHORTCUT_LOGS CTRL_MOD "L"
#define MENU_QUIT ICON_FA_POWER_OFF " Quit" #define MENU_QUIT ICON_FA_POWER_OFF " Quit"