diff --git a/app/SysTray-X/SysTray-X-app/preferences.cpp b/app/SysTray-X/SysTray-X-app/preferences.cpp index 11bab0c..489dea3 100644 --- a/app/SysTray-X/SysTray-X-app/preferences.cpp +++ b/app/SysTray-X/SysTray-X-app/preferences.cpp @@ -148,12 +148,26 @@ void Preferences::setBrowserVendor( const QString vendor ) } +/* + * Get the browser + */ +const QString& Preferences::getBrowserVersion() const +{ + return m_browser_version; +} + + /* * Set the browser */ void Preferences::setBrowserVersion( const QString version ) { m_browser_version = version; + + /* + * Tell the world the new preference + */ + emit signalBrowserVersion(); } diff --git a/app/SysTray-X/SysTray-X-app/preferences.h b/app/SysTray-X/SysTray-X-app/preferences.h index 8a7f370..4890a94 100644 --- a/app/SysTray-X/SysTray-X-app/preferences.h +++ b/app/SysTray-X/SysTray-X-app/preferences.h @@ -151,6 +151,13 @@ class Preferences : public QObject */ void setBrowserVendor( const QString vendor ); + /** + * @brief getBrowserVersion. Get the browser version. + * + * @return The browser version. + */ + const QString& getBrowserVersion() const; + /** * @brief setBrowserVersion. Set the browser version. * @@ -468,6 +475,11 @@ class Preferences : public QObject */ void signalConsole( QString message ); + /** + * @brief signalBrowserVersion. Signal the browser version. + */ + void signalBrowserVersion(); + /** * @brief signalDefaultIconTypeChange. Signal a default icon type change. */ diff --git a/app/SysTray-X/SysTray-X-app/preferencesdialog.cpp b/app/SysTray-X/SysTray-X-app/preferencesdialog.cpp index 0108104..a89fe7a 100644 --- a/app/SysTray-X/SysTray-X-app/preferencesdialog.cpp +++ b/app/SysTray-X/SysTray-X-app/preferencesdialog.cpp @@ -74,11 +74,6 @@ PreferencesDialog::PreferencesDialog( SysTrayXLink *link, Preferences *pref, QWi m_ui->countTypeGroup->setId( m_ui->unreadRadioButton, Preferences::PREF_COUNT_UNREAD ); m_ui->countTypeGroup->setId( m_ui->newRadioButton, Preferences::PREF_COUNT_NEW ); - /* - * Hide the count type for now - */ - m_ui->countTypeGroupBox->setVisible(false); - /* * Set icon type defaults */ @@ -543,6 +538,23 @@ void PreferencesDialog::slotDebugChange() } +/* + * Handle the browser version signal + */ +void PreferencesDialog::slotBrowserVersion() +{ + QString version = m_pref->getBrowserVersion(); + + if( version.section( '.', 0, 0 ).toInt() > 89 ) + { + /* + * Hide the count type for TB90 and up, not supported + */ + m_ui->countTypeGroupBox->setVisible( false ); + } +} + + /* * Handle the minimize type change signal */ diff --git a/app/SysTray-X/SysTray-X-app/preferencesdialog.h b/app/SysTray-X/SysTray-X-app/preferencesdialog.h index e928e8b..a9835c6 100644 --- a/app/SysTray-X/SysTray-X-app/preferencesdialog.h +++ b/app/SysTray-X/SysTray-X-app/preferencesdialog.h @@ -207,6 +207,11 @@ class PreferencesDialog : public QDialog */ void slotDebugChange(); + /** + * @brief slotBrowserVersion. Slot for handling the browser version signals. + */ + void slotBrowserVersion(); + /** * @brief slotMinimizeTypeChange. Slot for handling minimize type change signals. */ diff --git a/app/SysTray-X/SysTray-X-app/systrayx.cpp b/app/SysTray-X/SysTray-X-app/systrayx.cpp index a73bf85..453be5f 100644 --- a/app/SysTray-X/SysTray-X-app/systrayx.cpp +++ b/app/SysTray-X/SysTray-X-app/systrayx.cpp @@ -111,6 +111,7 @@ SysTrayX::SysTrayX( QObject *parent ) : QObject( parent ) connect( m_preferences, &Preferences::signalMinimizeTypeChange, m_win_ctrl, &WindowCtrl::slotMinimizeTypeChange ); connect( m_preferences, &Preferences::signalStartMinimizedChange, m_win_ctrl, &WindowCtrl::slotStartMinimizedChange ); + connect( m_preferences, &Preferences::signalBrowserVersion, m_pref_dialog, &PreferencesDialog::slotBrowserVersion ); connect( m_preferences, &Preferences::signalDefaultIconTypeChange, m_pref_dialog, &PreferencesDialog::slotDefaultIconTypeChange ); connect( m_preferences, &Preferences::signalDefaultIconDataChange, m_pref_dialog, &PreferencesDialog::slotDefaultIconDataChange ); connect( m_preferences, &Preferences::signalHideDefaultIconChange, m_pref_dialog, &PreferencesDialog::slotHideDefaultIconChange ); diff --git a/webext/js/options_accounts.js b/webext/js/options_accounts.js index 792162a..f260227 100644 --- a/webext/js/options_accounts.js +++ b/webext/js/options_accounts.js @@ -21,14 +21,8 @@ SysTrayX.Accounts = { if (BrowserInfo.version.split(".")[0] < 91) { return await browser.accounts.list(); } else { - console.debug("Get account with folders"); - const includeFolders = true; - const accounts = await browser.accounts.list(includeFolders); - - console.debug("Options accounts: " + JSON.stringify(accounts)); - - return accounts; + return await browser.accounts.list(includeFolders); } }, diff --git a/webext/options.html b/webext/options.html index 2ffa767..b49c3cb 100644 --- a/webext/options.html +++ b/webext/options.html @@ -398,7 +398,7 @@ /> - + info); + if (BrowserInfo.version.split(".")[0] > 89) { + document.getElementById("counttype").style.display = "none"; + } +} + +start(); + browser.storage.onChanged.addListener(SysTrayX.StorageChanged.changed);