Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gnc plugin page register to cpp #1874

Merged
merged 9 commits into from
Feb 26, 2024

Conversation

christopherlam
Copy link
Contributor

and will rebase #1873 on top of this.

@christopherlam christopherlam force-pushed the gnome-to-cpp branch 3 times, most recently from 5e1c457 to 1cac433 Compare February 24, 2024 15:43
@jralls
Copy link
Member

jralls commented Feb 24, 2024

That's a rather expansive PR title. "Plugin page register to C++" would be better. "CPP" is ambiguous because it can also mean the C pre-processor, the program that handles #define, #if and such.

@@ -3898,29 +3898,31 @@ gnc_plugin_page_register_cmd_reverse_transaction (GSimpleAction *simple,
{
const char *rev = _("A reversing entry has already been created for this transaction.");
const char *jump = _("Jump to the transaction?");
if (gnc_verify_dialog (GTK_WINDOW (window), TRUE, "%s\n\n%s", rev, jump))
goto jump_to_trans;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A better way to accomplish this would be to extract into new functions the two blocks, say maybe_jump_to_existing and maybe_create_reverse_transaction, then

if (auto new_trans{xaccTransactionGetReversedBy(trans)
{
    if (!maybe_jump_to_existing(/*…*/))
    {
        LEAVE ("reverse already exists");
        return;
    }
}
else
{
     if (!maybe_create_reverse_transaction(/*…*/))
     {
          LEAVE ("reverse cancelled");
          return;
      }
}

@christopherlam christopherlam changed the title Gnome to cpp Gnc plugin page register to cpp Feb 25, 2024
@christopherlam christopherlam force-pushed the gnome-to-cpp branch 2 times, most recently from bda5145 to ade9d6d Compare February 25, 2024 13:30
@christopherlam
Copy link
Contributor Author

uhm. maybe i'll split this into cpp conversion and cppisms in another branch.

@christopherlam christopherlam force-pushed the gnome-to-cpp branch 2 times, most recently from 782e114 to 810e4fd Compare February 26, 2024 01:23
@code-gnucash-org code-gnucash-org merged commit 6b1944f into Gnucash:stable Feb 26, 2024
4 checks passed
@christopherlam christopherlam deleted the gnome-to-cpp branch February 26, 2024 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants