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

Some fixes from me #68

Merged

Conversation

ruslangaripov
Copy link
Collaborator

@ruslangaripov ruslangaripov commented Sep 27, 2016

This PR fixes some issues.

ChangeLog:

2016-09-27 Ruslan Garipov brigadir15@gmail.com

  • locales/english.sample: Update ENU text strings.
  • projects/GEDKeeper2/GKCore/LangMan.cs (GKCore::LangMan::LSDefList): Likewise.
  • projects/GEDKeeper2/GKUI/BaseWin.cs (GKUI::BaseWin::NoteNameMaxLength): Add new member.
    (GKUI::BaseWin::GetHyperViewByType): Add new method.
    (GKUI::BaseWin::RecordNotify): Clear hyper view if necessary.
    (GKUI::BaseWin::RecordDelete): Reformat code. Change "Remove note" confirmation text building.
  • projects/GEDKeeper2/GKUI/Dialogs/NoteEditDlg.cs (GKUI::Dialogs::NoteEditDlg::btnAccept_Click): Ignore text with whitespaces only.

‡Ruslan Garipov added 5 commits September 27, 2016 08:45
See also: Serg-Norseman#59

Signed-off-by: ‡Ruslan Garipov <garipov.rn@yandex.ru>
See also: Serg-Norseman#61

Signed-off-by: ‡Ruslan Garipov <garipov.rn@yandex.ru>
When user deleted the last entry in an object list in a database
window, the right (hyper view) panel was continuing to show information
about the removed object. This commit fixes it.

See also: Serg-Norseman#61.

Signed-off-by: ‡Ruslan Garipov <garipov.rn@yandex.ru>
This commit fixes text of the note removing confirmation. Confirmation
text template (`LSID.LSID_NoteDeleteQuery`) contains a format
placeholder, but GK didn't use it.

Signed-off-by: ‡Ruslan Garipov <garipov.rn@yandex.ru>
This commit ignore "empty" notes on creation.

This commit also fix some ENU localization.

See also: Serg-Norseman#58

Signed-off-by: ‡Ruslan Garipov <garipov.rn@yandex.ru>
@codecov-io
Copy link

codecov-io commented Sep 27, 2016

Current coverage is 37.71% (diff: 11.02%)

Merging #68 into master will decrease coverage by 0.11%

@@             master        #68   diff @@
==========================================
  Files           322        322          
  Lines         50087      50193   +106   
  Methods        4585       4587     +2   
  Messages          0          0          
  Branches       4740       4746     +6   
==========================================
- Hits          18950      18931    -19   
- Misses        30516      30641   +125   
  Partials        621        621          

Powered by Codecov. Last update 7326671...1ede220

/* 241 */ "Are you sure you want to detach link to note?",
/* 242 */ "Are you sure you want to detach link to multimedia?",
/* 243 */ "Are you sure you want to detach link to source?",
/* 244 */ "Are you sure you want to remove the association?",
Copy link
Owner

Choose a reason for hiding this comment

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

To make changes to the default localization only once, you need to make changes only to LangMan. And then perform one run with the activated line SaveDefaultLanguage() in the constructor of the class MainWin. Then deactivate the line.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So... There's nothing I have to change in this PR because of this review entry? 👀

Copy link
Owner

Choose a reason for hiding this comment

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

Yes, nothing :)

view = mLocationSummary;
break;
}
}
Copy link
Owner

Choose a reason for hiding this comment

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

Two requests: to emphasize a separate "case" - use empty strings. If two or more "case" have a common implementation, an empty string is not needed. And second, if the body of the "case" consists of one to five lines and there are no variables that overlap in scope with other "case" - not to do a block "{ }".

Copy link
Owner

Choose a reason for hiding this comment

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

Would I need to fill the document with the conventions...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Would I need to fill the document with the conventions

No, this ain't necessary.

@ruslangaripov
Copy link
Collaborator Author

To make changes to the default localization only once, you need to make changes only to LangMan. And then perform one run with the activated line SaveDefaultLanguage() in the constructor of the class MainWin. Then deactivate the line.

Are you talking about automatic generating of 'locales/english.sample' file from langman.cs one? 'locales/english.sample' file is stored within this repo; I have to fix it at the same time with langman.cs.

msg = string.Format(LangMan.LS(
LSID.LSID_PersonDeleteQuery),
((GEDCOMIndividualRecord)record).GetNameString(
true, false));
Copy link
Owner

Choose a reason for hiding this comment

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

For me so uncomfortable. Let's at least that such intermediate format choose:

msg = string.Format(LangMan.LS(LSID.LSID_PersonDeleteQuery),
                            ((GEDCOMIndividualRecord)record).GetNameString(true, false));

Hereinafter.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As you wish. But you definitely exceed 80-characters per line limit.

I revert the code format back to your initial style -- one LONG expression per one line. I hate that, just like I hate this:

msg = string.Format(LangMan.LS(LSID.LSID_PersonDeleteQuery),
                            ((GEDCOMIndividualRecord)record).GetNameString(true, false));

Hereinafter 😆

Copy link
Owner

Choose a reason for hiding this comment

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

I'm sorry. I just don't understand, in terms of readability, when at least the first and relatively short argument divorced from the call.
It is possible and on another to write:

msg = string.Format(
    LangMan.LS(LSID.LSID_PersonDeleteQuery),
    ((GEDCOMIndividualRecord)record).GetNameString(true, false));

What here bad?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nothing. Except the fact that it still exceeds 80 characters limit 😃

I will try to accept your code conventions, I will! :godmode:

Copy link
Owner

Choose a reason for hiding this comment

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

I also will be thinking

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You shouldn't 😆 You set the rules as owner of this repo, and that's OK! And I have to obey those rules! 👍

{
value = string.Format("#{0}",
record.GetId().ToString());
}
Copy link
Owner

Choose a reason for hiding this comment

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

It is better to make a separate function (in GKUtils) - it can be embedded in one or two places.

Copy link
Owner

@Serg-Norseman Serg-Norseman left a comment

Choose a reason for hiding this comment

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

Cool work! A little touch up only

Signed-off-by: Ruslan Garipov <brigadir15@gmail.com>
@ruslangaripov
Copy link
Collaborator Author

@Serg-Norseman I fixed all your comments!

@Serg-Norseman Serg-Norseman merged commit f2a4310 into Serg-Norseman:master Sep 27, 2016
@ruslangaripov ruslangaripov deleted the users/brigadir/develop branch September 29, 2016 03:12
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.

None yet

3 participants