Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old Today, 06:34 PM   #976
Feoras
Member
Feoras began at the beginning.
 
Posts: 18
Karma: 10
Join Date: May 2023
Device: Kobo Glo
Hey there,

it's been awhile but thank you so much for all the improvements for this plugin and adding the bar/column daily chart!
Finally had some time to add all the books from previous years to the plugin too.

I just have one tiny issue ... that calibre closes without any error when I click on a month to open the daily chart.
I'm not quite sure why this happens. It happens with a dummy library with just one entry, column or line, no matter what calibre just closes.
To test if it is the daily html/code causing this, I replaced the starting monthly view with the daily view and this works - no crash.
Every other view works (genre, month, different year, all years).
So I am not sure what could cause this crash, especially since others do not seem to have this issue.
I am using calibre on Linux, so it might very well be an OS specific issue too ...
Feoras is offline   Reply With Quote
Old Today, 08:02 PM   #977
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,296
Karma: 1436993
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Quote:
Originally Posted by Feoras View Post
Hey there,

it's been awhile but thank you so much for all the improvements for this plugin and adding the bar/column daily chart!
Finally had some time to add all the books from previous years to the plugin too.

I just have one tiny issue ... that calibre closes without any error when I click on a month to open the daily chart.
I'm not quite sure why this happens. It happens with a dummy library with just one entry, column or line, no matter what calibre just closes.
To test if it is the daily html/code causing this, I replaced the starting monthly view with the daily view and this works - no crash.
Every other view works (genre, month, different year, all years).
So I am not sure what could cause this crash, especially since others do not seem to have this issue.
I am using calibre on Linux, so it might very well be an OS specific issue too ...
I'm sorry you having issues. I can't replicate the bug.If you have any more info, I would love to debug this
thiago.eec is offline   Reply With Quote
Advert
Old Today, 08:53 PM   #978
Feoras
Member
Feoras began at the beginning.
 
Posts: 18
Karma: 10
Join Date: May 2023
Device: Kobo Glo
Quote:
Originally Posted by thiago.eec View Post
I'm sorry you having issues. I can't replicate the bug.If you have any more info, I would love to debug this
I figured out that the issue is somewhere/within the navigationRequest handling:
Code:
self.browser.page().navigationRequested.connect(self.daily_pages_columns)
I replaced the navigationRequested with buttons, and this works. E.g. this:
Code:
class ReadingGoalStatisticsDialog(Dialog):
    def setup_ui(self) -> None:
        # ...
        self.change_view_menu.addItem(get_icon('genre_view.png'), _('By genre'))
        self.daily_button_jan = QPushButton(_('Jan'))
        self.h_layout.addWidget(self.daily_button_jan, 0, Qt.AlignRight)
        self.daily_button_jan.clicked.connect(lambda: self.on_daily_button('jan'))
        self.h_layout.addWidget(self.change_view_menu, 0, Qt.AlignRight)
        # ...
    # ...
    def on_daily_button(self, month) -> None:
        # this is basically daily_pages_columns with only the part in len(url) == 3 and url replaced with month
        daily_page_count = self.daily_page_count()
        daily_data = [[_('Days'), _('Pages')]]
        temp_daily_data = []
        for day in daily_page_count[month]:
            temp_daily_data.append([str(day), daily_page_count[month][day]])
        for item in temp_daily_data:
            daily_data.append(item)
        h_axis_title = _('Days')
        v_axis_title = _('Pages')
        previous_button = _('Previous')
        next_button = _('Next')
        main_title = month.upper()
        background_color = '#121212' if is_dark_theme() else '#ffffff'
        text_color = '#ddd' if is_dark_theme() else '#000000'
        _daily_html_column = daily_html_column
        formated_daily_html_column = _daily_html_column.format(daily_data, background_color, text_color,
                                                         h_axis_title, v_axis_title, main_title,
                                                         previous_button, next_button)
        self.browser.page().setHtml(formated_daily_html_column)
        self.month_name = deepcopy(month).lower()
        self.months = [x.lower() for x in daily_page_count.keys()]
        self.year_menu.setFocus()
Though the question is why the navigationRequest connect function leads to this issue of calibre just closing.
Any idea?
Feoras is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Reading List kiwidude Plugins 1430 09-03-2025 06:14 AM
[GUI Plugin] Save Virtual Libraries To Column (GUI) chaley Plugins 14 04-04-2021 06:25 AM
Reading Goal KyBunnies Audiobook Discussions 12 10-25-2017 06:29 PM


All times are GMT -4. The time now is 10:31 PM.


MobileRead.com is a privately owned, operated and funded community.