Remove obsolete title and window handling

This commit is contained in:
Ximi1970
2020-11-18 22:19:54 +01:00
parent b2e18aa614
commit 83767a7e20
5 changed files with 3 additions and 70 deletions

View File

@@ -148,7 +148,6 @@ SysTrayX::SysTrayX( QObject *parent ) : QObject( parent )
connect( m_link, &SysTrayXLink::signalErrorAddOnShutdown, this, &SysTrayX::slotErrorAddOnShutdown );
connect( m_link, &SysTrayXLink::signalWindowState, m_win_ctrl, &WindowCtrl::slotWindowState );
connect( m_link, &SysTrayXLink::signalUnreadMail, this, &SysTrayX::slotSetUnreadMail );
connect( m_link, &SysTrayXLink::signalTitle, m_win_ctrl, &WindowCtrl::slotWindowTitle );
connect( m_link, &SysTrayXLink::signalVersion, this, &SysTrayX::slotVersion );
connect( m_link, &SysTrayXLink::signalKdeIntegration, this, &SysTrayX::slotSelectIconObject );
connect( m_link, &SysTrayXLink::signalLocale, this, &SysTrayX::slotLoadLanguage );

View File

@@ -255,13 +255,13 @@ void SysTrayXLink::sendShutdown()
*/
void SysTrayXLink::sendDisableKdeIntegration()
{
QJsonObject shutdownObject;
shutdownObject.insert("kdeIntegration", QJsonValue::fromVariant( "false" ) );
QJsonObject integrationObject;
integrationObject.insert("kdeIntegration", QJsonValue::fromVariant( "false" ) );
/*
* Store the new document
*/
QJsonDocument json_doc = QJsonDocument( shutdownObject );
QJsonDocument json_doc = QJsonDocument( integrationObject );
/*
* Send it to the add-on
@@ -296,12 +296,6 @@ void SysTrayXLink::DecodeMessage( const QByteArray& message )
emit signalUnreadMail( unreadMail );
}
if( jsonObject.contains( "title" ) && jsonObject[ "title" ].isString() )
{
QString title = jsonObject[ "title" ].toString();
emit signalTitle( title );
}
if( jsonObject.contains( "version" ) && jsonObject[ "version" ].isString() )
{
QString version = jsonObject[ "version" ].toString();

View File

@@ -126,23 +126,6 @@ void WindowCtrl::slotWindowTest3()
}
/*
* Handle window title signal
*/
void WindowCtrl::slotWindowTitle( QString title )
{
/*
* Store the window title
*/
m_window_title = title;
/*
* Get the window IDs
*/
findWindow( title );
}
/*
* Handle change in minimize type change
*/

View File

@@ -71,13 +71,6 @@ class WindowCtrl : public QObject
*/
void slotWindowTest3();
/**
* @brief slotWindowTitle. Handle the window title signal.
*
* @param state The windows title.
*/
void slotWindowTitle( QString title );
/**
* @brief slotMinimizeTypeChange. Handle the minimize type signal.
*/
@@ -127,11 +120,6 @@ class WindowCtrl : public QObject
*/
QWindow* m_tb_window;
/**
* @brief m_window_title. Title of the TB window.
*/
QString m_window_title;
/**
* @brief m_start_minimized. State of start minimized.
*/

View File

@@ -32,9 +32,6 @@ SysTrayX.Messaging = {
// Send the browser info to app
SysTrayX.Messaging.sendBrowserInfo();
// Send the window title to app
SysTrayX.Messaging.sendTitle();
// Send version to app
SysTrayX.Messaging.sendVersion();
@@ -256,11 +253,6 @@ SysTrayX.Messaging = {
SysTrayX.Link.postSysTrayXMessage({ platformInfo: info });
},
sendTitle: function () {
const title = "-" + SysTrayX.Window.startWindow.title.split("-").pop();
SysTrayX.Link.postSysTrayXMessage({ title: title });
},
sendVersion: function () {
SysTrayX.Link.postSysTrayXMessage({ version: SysTrayX.version });
},
@@ -274,8 +266,6 @@ SysTrayX.Messaging = {
sendLocale: function () {
const locale = browser.i18n.getUILanguage();
console.log("Locale: " + locale);
SysTrayX.Link.postSysTrayXMessage({
locale: locale,
});
@@ -383,21 +373,6 @@ SysTrayX.Link = {
},
receiveSysTrayXMessage: function (response) {
if (response["window"]) {
if (response["window"] === "minimized") {
browser.windows.update(SysTrayX.Window.startWindow.id, {
state: "minimized",
});
}
if (response["window"] === "normal") {
browser.windows.update(SysTrayX.Window.startWindow.id, {
state: "normal",
focused: true,
});
}
}
if (response["shutdown"]) {
browser.windowEvent.onCloseButtonClick.removeListener(
SysTrayX.Messaging.onCloseButton
@@ -524,8 +499,6 @@ SysTrayX.Link = {
};
SysTrayX.Window = {
startWindow: undefined,
focusChanged: function (windowId) {
browser.windows.getCurrent().then((win) => {
SysTrayX.Link.postSysTrayXMessage({ window: win.state });
@@ -606,10 +579,6 @@ async function start() {
await getDefaultIcon();
await getIcon();
SysTrayX.Window.startWindow = await browser.windows
.getCurrent()
.then((currentWindow) => currentWindow);
// Get all accounts
SysTrayX.Messaging.accounts = await browser.accounts.list();