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

Callbook Info #557

Merged
merged 2 commits into from
Jan 11, 2025
Merged

Callbook Info #557

merged 2 commits into from
Jan 11, 2025

Conversation

aa5sh
Copy link

@aa5sh aa5sh commented Dec 21, 2024

Added a context menu item to the logbook widget to to allow for selected entries to fill missing information from online callbook source. It will not overwrite information that is there, just append any missing information. I am mostly interested in Email address and Name but figured I would add more information that others may find usefull. It is written to limit to 100 updates at a time.

image image

Added a context menu item to the logbook widget to to allow for selected entries to fill missing information from online callbook source.  It will not overwrite information that is there, just append any missing information.  I am mostly interested in Email address and Name but figured I would add more information that others may find usefull.
@kyleboyle
Copy link

Cool.. I would suggest changing the icon to something different - perhaps the same icon which is used for the save button.

@aa5sh
Copy link
Author

aa5sh commented Dec 23, 2024 via email

@foldynl
Copy link
Owner

foldynl commented Dec 25, 2024

I kept the ideas but modified the code. There were several issues that needed to be resolved. I also added a ProgressDialog. I believe we don't want to perform a Callbook lookup while simultaneously allowing operator to modify the same QSOs. It's also important to provide users some feedback that the progress is still in-progress. Modified code in BatchLookup branch.

@aa5sh
Copy link
Author

aa5sh commented Dec 25, 2024 via email

@aa5sh
Copy link
Author

aa5sh commented Dec 25, 2024

Ok really dumb question here. I was taking a look and it didn't seem to be working. I added a qWarning duplicating these lines and it started to work. Since you are starting with the qCDebug(runtime) would that make it only update in runtime and not when running from qt creator? image

@aa5sh
Copy link
Author

aa5sh commented Dec 25, 2024

I am still trying to best way to debug and all and I feel I am missing something I haven't figured out just yet. Right now I just put qWarning's everywhere to print out statements. I need to watch/read up on debuging because there is likely a way better way I am missing just yet.

@kyleboyle
Copy link

kyleboyle commented Dec 25, 2024

runtime is a logging category so-to-speak. You have to enable the logs you want output like QT_LOGGING_RULES=*.runtime.*

To debug, set breakpoints on lines of code and execute the debug target instead of run:
Screenshot 2024-12-25 184902
when a breakpoint hits you can inspect the stack, variable values, etc using the various debug tool panels.

@aa5sh
Copy link
Author

aa5sh commented Dec 26, 2024 via email

@aa5sh
Copy link
Author

aa5sh commented Dec 26, 2024

Ok I built a test copy and used a backup db. When I do a test it will add the name but not the email address. But oddly enough if I add the line for the qWarning like in my screenshot above it will add the email address.

@foldynl
Copy link
Owner

foldynl commented Dec 26, 2024

more about QCDebug on WIki. You can enabled/disable selected modules based on setting of QT_LOGGING_RULES. In your case

QT_LOGGING_RULES=qlog.ui.logbookwidget.*=true ./qlog

@aa5sh
Copy link
Author

aa5sh commented Dec 26, 2024 via email

@kyleboyle
Copy link

Yeah that's probably a bug - I'm not sure how qt handles suppression of logging statements when the rule isn't enabled... also setModeData should be renamed to setModelData.

@aa5sh
Copy link
Author

aa5sh commented Dec 26, 2024

setModeData is a function declared higher up in the the updateQSORecordFromCallbook function. So I think that is correct but I think it should be adjusted to be like this with the setModData on the next line.
`
auto setIfEmpty = [&](const LogbookModel::ColumnID id,
const QString &dataFieldID,
bool containsEnabled = false,
bool forceReplace = false)
{
const QString &callbookValue = data.value(dataFieldID);

    if ( callbookValue.isEmpty() )
        return;

    const QString &columnValue = getCurrIndexColumnValue(id);

    if ( columnValue.isEmpty()
         || (forceReplace && callbookValue != columnValue)
         || (containsEnabled
              && callbookValue.contains(columnValue)
              && callbookValue != columnValue) )
    {
        qCDebug(runtime) << "Changing"
                         << dataFieldID << callbookValue;
        setModeData(id, callbookValue);
    }
};

`

@kyleboyle
Copy link

Yes, I was merely dropping a note for Lada about the fact that the 'L' is missing on the function name, it should be called setModelData because it is changing the cell values in the table's model :)

@aa5sh
Copy link
Author

aa5sh commented Dec 27, 2024 via email

@foldynl
Copy link
Owner

foldynl commented Dec 27, 2024

Thanks for the info. Branch updated; Typo fixed, method moved outside of qcdebug.

@foldynl foldynl merged commit 84a9cc6 into foldynl:master Jan 11, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done - branch: testing_0.41
Development

Successfully merging this pull request may close these issues.

3 participants