mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-03 01:33:19 +00:00
Add default path when creating new source
This commit is contained in:
parent
14d04f6a77
commit
d6c781faa2
7 changed files with 24 additions and 6 deletions
|
@ -8,6 +8,7 @@
|
|||
#include "AppWindow.h"
|
||||
#include "SeleniteSetup.h"
|
||||
#include "Utils.h"
|
||||
#include "evalyte-cpp-common/evalyte.h"
|
||||
#include "mirai-core/DataProvider.h"
|
||||
#include "mirai-core/DateTime.h"
|
||||
#include "mirai-core/Day.h"
|
||||
|
@ -48,6 +49,10 @@ AppWindowBackend::AppWindowBackend(mirai::Mirai *miraiInstance)
|
|||
}
|
||||
);
|
||||
|
||||
addSourceWindow_->set_default_source_path(
|
||||
slint::SharedString(evalyte::dataDirectoryPath("mirai") + "/")
|
||||
);
|
||||
|
||||
const auto palettePath = std::string(getenv("HOME")) + "/.config/evalyte/theme.json";
|
||||
const auto palette = selenite::parseJson(palettePath);
|
||||
if (palette.has_value()) {
|
||||
|
@ -138,6 +143,8 @@ void AppWindowBackend::setupCallbacks()
|
|||
std::string(params.name), std::string(params.type), std::move(file)
|
||||
);
|
||||
addSourceWindow_->hide();
|
||||
view_.setAllSources();
|
||||
view_.update();
|
||||
reloadSources();
|
||||
reloadTasks();
|
||||
});
|
||||
|
|
|
@ -5,14 +5,15 @@
|
|||
*/
|
||||
|
||||
#include "AppWindowBackend.h"
|
||||
#include "evalyte-cpp-common/config.h"
|
||||
#include "evalyte-cpp-common/evalyte.h"
|
||||
#include "mirai-core/Mirai.h"
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
const auto configFilePath = evalyte::createConfigDirectoryPath("mirai") + "/config.json";
|
||||
evalyte::createRequiredDirectories("mirai");
|
||||
const auto configFilePath = evalyte::configDirectoryPath("mirai") + "/config.json";
|
||||
mirai::Mirai mirai{configFilePath};
|
||||
AppWindowBackend appWindow{&mirai};
|
||||
appWindow.run();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue