Skip to content

Commit

Permalink
Cannot select custom folder for report files in AppImage #942
Browse files Browse the repository at this point in the history
  • Loading branch information
Fanda Vacek committed Aug 25, 2023
1 parent 97517c3 commit 077c4c7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ ReportsSettingsPage::ReportsSettingsPage(QWidget *parent) :
//m_settingsDir = plugin->settingsDir() + "/reports";
m_caption = tr("Reports");
ui->setupUi(this);

ui->lblHelp->setText(ui->lblHelp->text().arg(defaultReportsDirectory()));
}

ReportsSettingsPage::~ReportsSettingsPage()
Expand Down Expand Up @@ -66,12 +68,17 @@ void ReportsSettingsPage::save()
qf::qmlwidgets::framework::Plugin::setReportsDir(dir);
}

QString ReportsSettingsPage::defaultReportsDirectory() const
{
return QCoreApplication::applicationDirPath() + "/reports";
}

QString ReportsSettingsPage::reportsDirectory() const
{
ReportsSettings settings;
auto dir = settings.reportsDirectory();
if(dir.isEmpty())
dir = QCoreApplication::applicationDirPath() + "/reports";
dir = defaultReportsDirectory();
return dir;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ private slots:
void load() override;
void save() override;

QString defaultReportsDirectory() const;

void setReportsDirectory(const QString dir);
private:
Ui::ReportsSettingsPage *ui;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
</layout>
</item>
<item>
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="lblHelp">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Reports directory is an directory, where QuickEvent is looking for reports definition QML files. It is populated during installation. Default reports directory is 'bin/reports' in QuickEvent install directory. If you want to have own reports, then you can make reports dir copy, modify QML files and redirect reports dir.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Reports directory is an directory, where QuickEvent is looking for reports definition QML files. It is populated during installation. Default reports directory is '%1' in QuickEvent install directory. If you want to have own reports, then you can make '%1' dir copy, modify QML files and redirect reports dir.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
Expand Down

0 comments on commit 077c4c7

Please sign in to comment.