Skip to content

Commit

Permalink
Merge pull request #3873 from vomikan/master
Browse files Browse the repository at this point in the history
fix(#3863): stage 1
  • Loading branch information
vomikan committed Sep 22, 2021
2 parents 796af8b + fc1a0c3 commit 884614a
Show file tree
Hide file tree
Showing 8 changed files with 7,785 additions and 340 deletions.
288 changes: 144 additions & 144 deletions po/be_BY.po

Large diffs are not rendered by default.

303 changes: 157 additions & 146 deletions po/mmex.pot

Large diffs are not rendered by default.

7,334 changes: 7,334 additions & 0 deletions po/sr.po

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions po/uk_UA.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: moneymanagerex\n"
"Report-Msgid-Bugs-To: developer@moneymanagerex.org\n"
"POT-Creation-Date: 2021-08-31 10:25+0300\n"
"PO-Revision-Date: 2021-08-31 07:31\n"
"PO-Revision-Date: 2021-09-18 18:44\n"
"Last-Translator: \n"
"Language-Team: Ukrainian\n"
"MIME-Version: 1.0\n"
Expand All @@ -25,15 +25,15 @@ msgstr ""

#: aboutdialog.cpp:55
msgid "License agreement"
msgstr ""
msgstr "Ліцензійна угода"

#: aboutdialog.cpp:187
msgid "About"
msgstr ""
msgstr "Про програму"

#: aboutdialog.cpp:192
msgid "Authors"
msgstr ""
msgstr "Автори"

#: aboutdialog.cpp:197
msgid "Sponsors"
Expand All @@ -45,15 +45,15 @@ msgstr "Ліцензія"

#: aboutdialog.cpp:207
msgid "Privacy"
msgstr ""
msgstr "Конфіденційність"

#: aboutdialog.cpp:245 optionsettingsnet.cpp:114
msgid "Send anonymous statistics usage data"
msgstr ""
msgstr "Надсилати анонімну статистику про використання даних"

#: aboutdialog.cpp:246 optionsettingsnet.cpp:116
msgid "Enable to help us sending anonymous data about MMEX usage."
msgstr ""
msgstr "Увімкніть, щоб допомогти нам надсилати анонімні дані про використання MMEX."

#: aboutdialog.cpp:253 accountdialog.cpp:306 appstartdialog.cpp:137
#: assetdialog.cpp:305 attachmentdialog.cpp:120 billsdepositsdialog.cpp:491
Expand All @@ -68,7 +68,7 @@ msgstr ""
#: splittransactionsdialog.cpp:172 transactionsupdatedialog.cpp:240
#: transdialog.cpp:606 wizard_update.cpp:192
msgid "&OK "
msgstr ""
msgstr "&ОК "

#: accountdialog.cpp:111 mmframe.cpp:1479
msgid "Edit Account"
Expand Down Expand Up @@ -101,7 +101,7 @@ msgstr "Вкажіть, чи цей рахунок закрито. Закрит
#: accountdialog.cpp:165
#, c-format
msgid "Initial Balance: %s"
msgstr ""
msgstr "Початковий баланс: %s"

#: accountdialog.cpp:169
msgid "Enter the initial balance in this account."
Expand Down Expand Up @@ -150,7 +150,7 @@ msgstr "Інше"

#: accountdialog.cpp:209
msgid "Card Number:"
msgstr ""
msgstr "Номер картки:"

#: accountdialog.cpp:209
msgid "Account Number:"
Expand Down Expand Up @@ -425,19 +425,19 @@ msgstr "Введіть примітки до цьго майна"

#: assetdialog.cpp:268
msgid "New Transaction Details"
msgstr ""
msgstr "Нові деталі транзакції"

#: assetdialog.cpp:271 sharetransactiondialog.cpp:296
msgid "Edit Transaction Details"
msgstr ""
msgstr "Редагувати деталі транзакції"

#: assetdialog.cpp:306 constants.cpp:73 sharetransactiondialog.cpp:326
msgid "&Cancel "
msgstr ""
msgstr "Скасувати "

#: assetdialog.cpp:402 sharetransactiondialog.cpp:434
msgid "Invalid Transaction"
msgstr ""
msgstr "Невірна транзакція"

#: assetdialog.cpp:409
msgid "Asset Account not found.\n\n"
Expand Down Expand Up @@ -605,7 +605,7 @@ msgstr ""
#: attachmentdialog.cpp:56 import_export/qif_export.cpp:194
#: import_export/univcsvdialog.cpp:181
msgid "File"
msgstr ""
msgstr "Файл"

#: attachmentdialog.cpp:64
msgid "Attachment folder not defined."
Expand Down
80 changes: 78 additions & 2 deletions src/filtertransdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,18 @@ void mmFilterTransactionsDialog::CreateControls()
colourValue_ = 0;
itemPanelSizer->Add(colourButton_, g_flagsExpand);

//Hide columns
showColumnsCheckBox_ = new wxCheckBox(itemPanel, wxID_ANY, _("Hide Columns")
, wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
itemPanelSizer->Add(showColumnsCheckBox_, g_flagsH);

bShowColumns_ = new wxButton(itemPanel, ID_DIALOG_COLUMNS, "");
bShowColumns_->SetMinSize(wxSize(180, -1));
bShowColumns_->Connect(wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED
, wxCommandEventHandler(mmFilterTransactionsDialog::OnShowColumnsButton), nullptr, this);
itemPanelSizer->Add(bShowColumns_, g_flagsExpand);


// Settings
wxBoxSizer* settings_box_sizer = new wxBoxSizer(wxHORIZONTAL);

Expand Down Expand Up @@ -459,6 +471,7 @@ void mmFilterTransactionsDialog::OnCheckboxClick(wxCommandEvent& event)
fromDateCtrl_->Enable(dateRangeCheckBox_->IsChecked());
toDateControl_->Enable(dateRangeCheckBox_->IsChecked());
colourButton_->Enable(colourCheckBox_->IsChecked());
bShowColumns_->Enable(showColumnsCheckBox_->IsChecked());
}

if (accountCheckBox_->IsChecked() && selected_accounts_id_.size() <= 0)
Expand Down Expand Up @@ -611,6 +624,61 @@ void mmFilterTransactionsDialog::OnCategs(wxCommandEvent& /*event*/)
}
}

void mmFilterTransactionsDialog::OnShowColumnsButton(wxCommandEvent& /*event*/)
{
wxArrayString column_names;
column_names.Add("ID");
column_names.Add("Color");
column_names.Add("Date");
column_names.Add("Number");
column_names.Add("Account");
column_names.Add("Payee");
column_names.Add("Status");
column_names.Add("Category");
column_names.Add("Type");
column_names.Add("Amount");
column_names.Add("Notes");

wxMultiChoiceDialog s_col(this, _("Hide Report Columns")
, "", column_names);

wxButton* ok = static_cast<wxButton*>(s_col.FindWindow(wxID_OK));
if (ok) ok->SetLabel(_("&OK "));
wxButton* ca = static_cast<wxButton*>(s_col.FindWindow(wxID_CANCEL));
if (ca) ca->SetLabel(wxGetTranslation(g_CancelLabel));

wxString baloon = "";
wxArrayInt selected_items;

selected_columns_id_.Clear();
bShowColumns_->UnsetToolTip();

if (s_col.ShowModal() == wxID_OK)
{
selected_items = s_col.GetSelections();
for (const auto &entry : selected_items)
{
int index = entry;
const wxString column_name = column_names[index];
selected_columns_id_.Add(index);
baloon += wxGetTranslation(column_name) + "\n";
}
}


if (selected_columns_id_.GetCount() == 0)
{
bShowColumns_->SetLabelText("");
showColumnsCheckBox_->SetValue(false);
bShowColumns_->Disable();
}
else if (selected_columns_id_.GetCount() > 0)
{
bShowColumns_->SetLabelText("...");
mmToolTip(bShowColumns_, baloon);
}
}

bool mmFilterTransactionsDialog::isSomethingSelected()
{
return
Expand Down Expand Up @@ -1312,6 +1380,11 @@ const wxArrayInt mmFilterTransactionsDialog::getAccountsID() const
return selected_accounts_id_;
}

const wxArrayInt mmFilterTransactionsDialog::getHideColumnsID() const
{
return selected_columns_id_;
}

bool mmFilterTransactionsDialog::getStatusCheckBox()
{
return statusCheckBox_->IsChecked();
Expand All @@ -1322,6 +1395,11 @@ bool mmFilterTransactionsDialog::getAccountCheckBox()
return accountCheckBox_->GetValue() && !selected_accounts_id_.empty();
}

bool mmFilterTransactionsDialog::getHideColumnsCheckBox()
{
return showColumnsCheckBox_->GetValue();
}

bool mmFilterTransactionsDialog::getCategoryCheckBox()
{
return categoryCheckBox_->IsChecked();
Expand Down Expand Up @@ -1441,7 +1519,6 @@ void mmFilterTransactionsDialog::OnSaveSettings(wxCommandEvent& WXUNUSED(event))

void mmFilterTransactionsDialog::OnAccountsButton(wxCommandEvent& WXUNUSED(event))
{
bSelectedAccounts_->UnsetToolTip();
wxMultiChoiceDialog s_acc(this, _("Choose Accounts")
, "" , m_accounts_name);

Expand Down Expand Up @@ -1494,7 +1571,6 @@ void mmFilterTransactionsDialog::OnAccountsButton(wxCommandEvent& WXUNUSED(event
bSelectedAccounts_->SetLabelText("...");
mmToolTip(bSelectedAccounts_, baloon);
}

}

void mmFilterTransactionsDialog::OnColourButton(wxCommandEvent& /*event*/)
Expand Down
18 changes: 14 additions & 4 deletions src/filtertransdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,25 @@ class mmFilterTransactionsDialog: public wxDialog
const wxString getDescriptionToolTip();
void getDescription(mmHTMLBuilder &hb);
void ResetFilterStatus();

bool isSomethingSelected();
bool getStatusCheckBox();
bool getAccountCheckBox();
const wxArrayInt getAccountsID() const;
bool getCategoryCheckBox();

bool getSimilarStatus();
bool getDateRangeCheckBox();
bool getStartDateCheckBox();
bool getHideColumnsCheckBox();

int getCategId();
int getSubCategId();
const wxArrayInt getAccountsID() const;
const wxArrayInt getHideColumnsID() const;

void SetStoredSettings(int id);

const wxString getBeginDate() { return m_begin_date; };
const wxString getEndDate() { return m_end_date; };
bool getDateRangeCheckBox();
bool getStartDateCheckBox();

private:
void BuildPayeeList();
Expand Down Expand Up @@ -128,6 +132,7 @@ class mmFilterTransactionsDialog: public wxDialog
void SaveSettings(int menu_item);
void OnAccountsButton(wxCommandEvent& WXUNUSED(event));
void OnColourButton(wxCommandEvent& /*event*/);
void OnShowColumnsButton(wxCommandEvent& /*event*/);

void OnCategs(wxCommandEvent& event);
const wxString to_json(bool i18n = false);
Expand Down Expand Up @@ -172,6 +177,9 @@ class mmFilterTransactionsDialog: public wxDialog
wxButton* colourButton_;
int colourValue_;

wxCheckBox* showColumnsCheckBox_;
wxButton* bShowColumns_;

int categID_;
int subcategID_;
int payeeID_;
Expand All @@ -183,12 +191,14 @@ class mmFilterTransactionsDialog: public wxDialog
wxArrayString m_accounts_name;
//Selected accountns ID
wxArrayInt selected_accounts_id_;
wxArrayInt selected_columns_id_;

enum
{
/* FIlter Dialog */
ID_DIALOG_DATEPRESET= wxID_HIGHEST + 900,
ID_DIALOG_COLOUR,
ID_DIALOG_COLUMNS,
};
};

Expand Down

0 comments on commit 884614a

Please sign in to comment.