@@ -133,6 +134,10 @@ SysTrayX::SysTrayX( QObject *parent ) : QObject( parent )
connect( m_preferences, &Preferences::signalRestoreWindowPositionsChange, m_pref_dialog, &PreferencesDialog::slotRestoreWindowPositionsChange );
connect( m_preferences, &Preferences::signalCloseTypeChange, m_pref_dialog, &PreferencesDialog::slotCloseTypeChange );
connect( m_preferences, &Preferences::signalThemeChange, m_pref_dialog, &PreferencesDialog::slotThemeChange );
+ connect( m_preferences, &Preferences::signalStartAppChange, m_pref_dialog, &PreferencesDialog::slotStartAppChange );
+ connect( m_preferences, &Preferences::signalStartAppArgsChange, m_pref_dialog, &PreferencesDialog::slotStartAppArgsChange );
+ connect( m_preferences, &Preferences::signalCloseAppChange, m_pref_dialog, &PreferencesDialog::slotCloseAppChange );
+ connect( m_preferences, &Preferences::signalCloseAppArgsChange, m_pref_dialog, &PreferencesDialog::slotCloseAppArgsChange );
connect( m_preferences, &Preferences::signalDebugChange, m_pref_dialog, &PreferencesDialog::slotDebugChange );
connect( m_preferences, &Preferences::signalDefaultIconTypeChange, m_link, &SysTrayXLink::slotDefaultIconTypeChange );
@@ -153,6 +158,10 @@ SysTrayX::SysTrayX( QObject *parent ) : QObject( parent )
connect( m_preferences, &Preferences::signalRestoreWindowPositionsChange, m_link, &SysTrayXLink::slotRestoreWindowPositionsChange );
connect( m_preferences, &Preferences::signalCloseTypeChange, m_link, &SysTrayXLink::slotCloseTypeChange );
connect( m_preferences, &Preferences::signalThemeChange, m_link, &SysTrayXLink::slotThemeChange );
+ connect( m_preferences, &Preferences::signalStartAppChange, m_link, &SysTrayXLink::slotStartAppChange );
+ connect( m_preferences, &Preferences::signalStartAppArgsChange, m_link, &SysTrayXLink::slotStartAppArgsChange );
+ connect( m_preferences, &Preferences::signalCloseAppChange, m_link, &SysTrayXLink::slotCloseAppChange );
+ connect( m_preferences, &Preferences::signalCloseAppArgsChange, m_link, &SysTrayXLink::slotCloseAppArgsChange );
connect( m_preferences, &Preferences::signalDebugChange, m_link, &SysTrayXLink::slotDebugChange );
connect( m_preferences, &Preferences::signalHideDefaultIconChange, this, &SysTrayX::slotSelectIconObjectPref );
@@ -168,6 +177,8 @@ SysTrayX::SysTrayX( QObject *parent ) : QObject( parent )
connect( m_link, &SysTrayXLink::signalVersion, this, &SysTrayX::slotVersion );
connect( m_link, &SysTrayXLink::signalKdeIntegration, this, &SysTrayX::slotSelectIconObject );
connect( m_link, &SysTrayXLink::signalLocale, this, &SysTrayX::slotLoadLanguage );
+ connect( m_link, &SysTrayXLink::signalStartApp, this, &SysTrayX::slotStartApp );
+ connect( m_link, &SysTrayXLink::signalCloseApp, this, &SysTrayX::slotCloseApp );
#ifdef Q_OS_UNIX
@@ -195,7 +206,15 @@ SysTrayX::SysTrayX( QObject *parent ) : QObject( parent )
//slotLoadLanguage( "ru" );
slotSelectIconObject( false );
+<<<<<<< HEAD
slotMailCount( 10, 1 );
+=======
+ slotSetUnreadMail( 10 );
+
+ m_preferences->setStartApp( "/home/maxime/test.sh" );
+ m_preferences->setStartAppArgs( "/home/maxime/startup.txt StartupString" );
+ slotStartApp();
+>>>>>>> develop
*/
}
@@ -573,6 +592,11 @@ void SysTrayX::slotErrorAddOnShutdown()
m_tray_icon->hide();
}
+ /*
+ * Launch close application
+ */
+ slotCloseApp();
+
/*
* Let's quit
*/
@@ -705,3 +729,36 @@ void SysTrayX::slotLoadLanguage( QString locale )
qApp->installTranslator( &m_translator );
}
}
+
+
+/*
+ * Handle a startup app launch request
+ */
+void SysTrayX::slotStartApp()
+{
+ QString app = m_preferences->getStartApp();
+ QString args = m_preferences->getStartAppArgs();
+ QStringList args_list = args.split( ' ', Qt::SkipEmptyParts );
+
+ if( !app.isEmpty() )
+ {
+ QProcess::startDetached( app, args_list );
+ }
+}
+
+
+/*
+ * Handle a close app launch request
+ */
+void SysTrayX::slotCloseApp()
+{
+ QString app = m_preferences->getCloseApp();
+ QString args = m_preferences->getCloseAppArgs();
+ QStringList args_list = args.split( ' ', Qt::SkipEmptyParts );
+
+ if( !app.isEmpty() )
+ {
+ QProcess::startDetached( app, args_list );
+ }
+}
+
diff --git a/app/SysTray-X/SysTray-X-app/systrayx.h b/app/SysTray-X/SysTray-X-app/systrayx.h
index 889f71e..ca45918 100644
--- a/app/SysTray-X/SysTray-X-app/systrayx.h
+++ b/app/SysTray-X/SysTray-X-app/systrayx.h
@@ -140,6 +140,16 @@ class SysTrayX : public QObject
*/
void slotLoadLanguage( QString locale );
+ /**
+ * @brief slotStartApp. Handle a start app launch request.
+ */
+ void slotStartApp();
+
+ /**
+ * @brief slotCloseApp. Handle a close app launch request.
+ */
+ void slotCloseApp();
+
private slots:
/**
diff --git a/app/SysTray-X/SysTray-X-app/systrayxlink.cpp b/app/SysTray-X/SysTray-X-app/systrayxlink.cpp
index af1d06c..f3af352 100644
--- a/app/SysTray-X/SysTray-X-app/systrayxlink.cpp
+++ b/app/SysTray-X/SysTray-X-app/systrayxlink.cpp
@@ -351,6 +351,14 @@ void SysTrayXLink::DecodeMessage( const QByteArray& message )
if( jsonObject.contains( "shutdown" ) && jsonObject[ "shutdown" ].isString() )
{
+ /*
+ * Launch close appplication
+ */
+ emit signalCloseApp();
+
+ /*
+ * Shutdown the addon
+ */
emit signalAddOnShutdown();
}
@@ -446,6 +454,26 @@ void SysTrayXLink::DecodeMessage( const QByteArray& message )
{
DecodePreferences( jsonObject[ "preferences" ].toObject() );
}
+
+ if( jsonObject.contains( "startApp" ) && jsonObject[ "startApp" ].isString() &&
+ jsonObject.contains( "startAppArgs" ) && jsonObject[ "startAppArgs" ].isString() )
+ {
+ QString app = jsonObject[ "startApp" ].toString();
+ QString args = jsonObject[ "startAppArgs" ].toString();
+
+ /*
+ * Store the new start application parameters
+ */
+ m_pref->setStartApp( app );
+ m_pref->setStartAppArgs( args );
+
+ emit signalStartApp();
+ }
+
+ if( jsonObject.contains( "closeApp" ) && jsonObject[ "closeApp" ].isString() )
+ {
+ emit signalCloseApp();
+ }
}
}
@@ -783,6 +811,46 @@ void SysTrayXLink::DecodePreferences( const QJsonObject& pref )
m_pref->setTheme( theme );
}
+ if( pref.contains( "startApp" ) && pref[ "startApp" ].isString() )
+ {
+ QString app = pref[ "startApp" ].toString();
+
+ /*
+ * Store the new start application
+ */
+ m_pref->setStartApp( app );
+ }
+
+ if( pref.contains( "startAppArgs" ) && pref[ "startAppArgs" ].isString() )
+ {
+ QString args = pref[ "startAppArgs" ].toString();
+
+ /*
+ * Store the new start application arguments
+ */
+ m_pref->setStartAppArgs( args );
+ }
+
+ if( pref.contains( "closeApp" ) && pref[ "closeApp" ].isString() )
+ {
+ QString app = pref[ "closeApp" ].toString();
+
+ /*
+ * Store the new close application
+ */
+ m_pref->setCloseApp( app );
+ }
+
+ if( pref.contains( "closeAppArgs" ) && pref[ "closeAppArgs" ].isString() )
+ {
+ QString args = pref[ "closeAppArgs" ].toString();
+
+ /*
+ * Store the new close application arguments
+ */
+ m_pref->setCloseAppArgs( args );
+ }
+
if( pref.contains( "debug" ) && pref[ "debug" ].isString() )
{
bool debug = pref[ "debug" ].toString() == "true";
@@ -863,6 +931,11 @@ void SysTrayXLink::EncodePreferences( const Preferences& pref )
prefObject.insert("startupDelay", QJsonValue::fromVariant( QString::number( pref.getStartupDelay() ) ) );
prefObject.insert("theme", QJsonValue::fromVariant( QString::number( pref.getTheme() ) ) );
+ prefObject.insert("startApp", QJsonValue::fromVariant( pref.getStartApp() ) );
+ prefObject.insert("startAppArgs", QJsonValue::fromVariant( pref.getStartAppArgs() ) );
+ prefObject.insert("closeApp", QJsonValue::fromVariant( pref.getCloseApp() ) );
+ prefObject.insert("closeAppArgs", QJsonValue::fromVariant( pref.getCloseAppArgs() ) );
+
QJsonObject preferencesObject;
preferencesObject.insert("preferences", prefObject );
@@ -1129,3 +1202,51 @@ void SysTrayXLink::slotThemeChange()
sendPreferences();
}
}
+
+
+/*
+ * Handle a start application change signal
+ */
+void SysTrayXLink::slotStartAppChange()
+{
+ if( m_pref->getAppPrefChanged() )
+ {
+ sendPreferences();
+ }
+}
+
+
+/*
+ * Handle a start application arguments change signal
+ */
+void SysTrayXLink::slotStartAppArgsChange()
+{
+ if( m_pref->getAppPrefChanged() )
+ {
+ sendPreferences();
+ }
+}
+
+
+/*
+ * Handle a close application change signal
+ */
+void SysTrayXLink::slotCloseAppChange()
+{
+ if( m_pref->getAppPrefChanged() )
+ {
+ sendPreferences();
+ }
+}
+
+
+/*
+ * Handle a close application arguments change signal
+ */
+void SysTrayXLink::slotCloseAppArgsChange()
+{
+ if( m_pref->getAppPrefChanged() )
+ {
+ sendPreferences();
+ }
+}
diff --git a/app/SysTray-X/SysTray-X-app/systrayxlink.h b/app/SysTray-X/SysTray-X-app/systrayxlink.h
index 670d1a7..bab500e 100644
--- a/app/SysTray-X/SysTray-X-app/systrayxlink.h
+++ b/app/SysTray-X/SysTray-X-app/systrayxlink.h
@@ -242,6 +242,16 @@ class SysTrayXLink : public QObject
*/
void signalWindowPositions( QList< QPoint > window_positions );
+ /**
+ * @brief signalStartApp. Signal the start app launch request.
+ */
+ void signalStartApp();
+
+ /**
+ * @brief signalCloseApp. Signal the close app launch request.
+ */
+ void signalCloseApp();
+
public slots:
/**
@@ -344,7 +354,27 @@ class SysTrayXLink : public QObject
*/
void slotThemeChange();
- private slots:
+ /**
+ * @brief slotStartAppChange. Slot for handling start application change signals.
+ */
+ void slotStartAppChange();
+
+ /**
+ * @brief slotStartAppArgsChange. Slot for handling start application arguments change signals.
+ */
+ void slotStartAppArgsChange();
+
+ /**
+ * @brief slotCloseAppChange. Slot for handling close application change signals.
+ */
+ void slotCloseAppChange();
+
+ /**
+ * @brief slotCloseAppArgsChange. Slot for handling close application arguments change signals.
+ */
+ void slotCloseAppArgsChange();
+
+ private slots:
/**
* @brief slotLinkRead. Read the link.
diff --git a/webext/_locales/de/messages.json b/webext/_locales/de/messages.json
index 7221578..1b12b34 100644
--- a/webext/_locales/de/messages.json
+++ b/webext/_locales/de/messages.json
@@ -34,6 +34,11 @@
"description": "Tab for Icon options"
},
+ "tab_apps": {
+ "message": "Anwendungen",
+ "description": "Tab for Apps options"
+ },
+
"tab_mail": {
"message": "Nachrichten",
"description": "Tab for Mail options"
@@ -304,6 +309,41 @@
"description": "The dark theme"
},
+ "apps": {
+ "message": "Anwendungen",
+ "description": "Title for Apps options"
+ },
+
+ "start_application": {
+ "message": "Startanwendung",
+ "description": "The start application parameters"
+ },
+
+ "start_app": {
+ "message": "Anwendung: ",
+ "description": "The start application"
+ },
+
+ "start_app_args": {
+ "message": "Argumente: ",
+ "description": "Arguments for a start application"
+ },
+
+ "close_application": {
+ "message": "Stopanwendung",
+ "description": "The close application parameters"
+ },
+
+ "close_app": {
+ "message": "Anwendung: ",
+ "description": "The close application"
+ },
+
+ "close_app_args": {
+ "message": "Argumente: ",
+ "description": "Arguments for a close application"
+ },
+
"accounts": {
"message": "Konten",
"description": "Title for Accounts options"
diff --git a/webext/_locales/el/messages.json b/webext/_locales/el/messages.json
index a44c7ed..cc3b4ab 100644
--- a/webext/_locales/el/messages.json
+++ b/webext/_locales/el/messages.json
@@ -34,6 +34,11 @@
"description": "Tab for Icon options"
},
+ "tab_apps": {
+ "message": "Εφαρμογές",
+ "description": "Tab for Apps options"
+ },
+
"tab_mail": {
"message": "Αλληλογραφία",
"description": "Tab for Mail options"
@@ -304,6 +309,41 @@
"description": "The dark theme"
},
+ "apps": {
+ "message": "Εφαρμογές",
+ "description": "Title for Apps options"
+ },
+
+ "start_application": {
+ "message": "Εφαρμογή εκκίνησης",
+ "description": "The start application parameters"
+ },
+
+ "start_app": {
+ "message": "Εφαρμογή: ",
+ "description": "The start application"
+ },
+
+ "start_app_args": {
+ "message": "Επιχειρήματα: ",
+ "description": "Arguments for a start application"
+ },
+
+ "close_application": {
+ "message": "Κλείσιμο αίτησης",
+ "description": "The close application parameters"
+ },
+
+ "close_app": {
+ "message": "Εφαρμογή: ",
+ "description": "The close application"
+ },
+
+ "close_app_args": {
+ "message": "Επιχειρήματα: ",
+ "description": "Arguments for a close application"
+ },
+
"accounts": {
"message": "Λογαριασμοί",
"description": "Title for Accounts options"
diff --git a/webext/_locales/en-US/messages.json b/webext/_locales/en-US/messages.json
index 38a468f..48e9fc7 100644
--- a/webext/_locales/en-US/messages.json
+++ b/webext/_locales/en-US/messages.json
@@ -34,6 +34,11 @@
"description": "Tab for Icon options"
},
+ "tab_apps": {
+ "message": "Apps",
+ "description": "Tab for Apps options"
+ },
+
"tab_mail": {
"message": "Mail",
"description": "Tab for Mail options"
@@ -304,6 +309,41 @@
"description": "The dark theme"
},
+ "apps": {
+ "message": "Apps",
+ "description": "Title for Apps options"
+ },
+
+ "start_application": {
+ "message": "Start application",
+ "description": "The start application parameters"
+ },
+
+ "start_app": {
+ "message": "Application: ",
+ "description": "The start application"
+ },
+
+ "start_app_args": {
+ "message": "Arguments: ",
+ "description": "Arguments for a start application"
+ },
+
+ "close_application": {
+ "message": "Closing application",
+ "description": "The close application parameters"
+ },
+
+ "close_app": {
+ "message": "Application: ",
+ "description": "The close application"
+ },
+
+ "close_app_args": {
+ "message": "Arguments: ",
+ "description": "Arguments for a close application"
+ },
+
"accounts": {
"message": "Accounts",
"description": "Title for Accounts options"
diff --git a/webext/_locales/it/messages.json b/webext/_locales/it/messages.json
index 04bce52..864ff45 100644
--- a/webext/_locales/it/messages.json
+++ b/webext/_locales/it/messages.json
@@ -34,6 +34,11 @@
"description": "Tab for Icon options"
},
+ "tab_apps": {
+ "message": "Applicazioni",
+ "description": "Tab for Apps options"
+ },
+
"tab_mail": {
"message": "Posta",
"description": "Tab for Mail options"
@@ -304,6 +309,41 @@
"description": "The dark theme"
},
+ "apps": {
+ "message": "Applicazioni",
+ "description": "Title for Apps options"
+ },
+
+ "start_application": {
+ "message": "Applicazione di avvio",
+ "description": "The start application parameters"
+ },
+
+ "start_app": {
+ "message": "Applicazione: ",
+ "description": "The start application"
+ },
+
+ "start_app_args": {
+ "message": "Argomenti: ",
+ "description": "Arguments for a start application"
+ },
+
+ "close_application": {
+ "message": "Applicazione alla chiusura",
+ "description": "The close application parameters"
+ },
+
+ "close_app": {
+ "message": "Applicazione: ",
+ "description": "The close application"
+ },
+
+ "close_app_args": {
+ "message": "Argomenti: ",
+ "description": "Arguments for a close application"
+ },
+
"accounts": {
"message": "Account",
"description": "Title for Accounts options"
diff --git a/webext/_locales/nl/messages.json b/webext/_locales/nl/messages.json
index bad4550..156b29a 100644
--- a/webext/_locales/nl/messages.json
+++ b/webext/_locales/nl/messages.json
@@ -34,6 +34,11 @@
"description": "Tab for Icon options"
},
+ "tab_apps": {
+ "message": "Apps",
+ "description": "Tab for Apps options"
+ },
+
"tab_mail": {
"message": "Berichten",
"description": "Tab for Mail options"
@@ -304,6 +309,41 @@
"description": "The dark theme"
},
+ "apps": {
+ "message": "Apps",
+ "description": "Title for Apps options"
+ },
+
+ "start_application": {
+ "message": "Start programma",
+ "description": "The start application parameters"
+ },
+
+ "start_app": {
+ "message": "Programma: ",
+ "description": "The start application"
+ },
+
+ "start_app_args": {
+ "message": "Argumenten: ",
+ "description": "Arguments for a start application"
+ },
+
+ "close_application": {
+ "message": "Stop programma",
+ "description": "The close application parameters"
+ },
+
+ "close_app": {
+ "message": "Programma: ",
+ "description": "The close application"
+ },
+
+ "close_app_args": {
+ "message": "Argumenten: ",
+ "description": "Arguments for a close application"
+ },
+
"accounts": {
"message": "Accounts",
"description": "Title for Accounts options"
diff --git a/webext/_locales/pt-BR/messages.json b/webext/_locales/pt-BR/messages.json
index c24b0b5..0b65ab1 100644
--- a/webext/_locales/pt-BR/messages.json
+++ b/webext/_locales/pt-BR/messages.json
@@ -34,6 +34,11 @@
"description": "Tab for Icon options"
},
+ "tab_apps": {
+ "message": "Aplicativos",
+ "description": "Tab for Apps options"
+ },
+
"tab_mail": {
"message": "E-mail",
"description": "Tab for Mail options"
@@ -304,6 +309,41 @@
"description": "The dark theme"
},
+ "apps": {
+ "message": "Aplicativos",
+ "description": "Title for Apps options"
+ },
+
+ "start_application": {
+ "message": "Aplicativo de inicialização",
+ "description": "The start application parameters"
+ },
+
+ "start_app": {
+ "message": "Aplicativo: ",
+ "description": "The start application"
+ },
+
+ "start_app_args": {
+ "message": "Argumentos: ",
+ "description": "Arguments for a start application"
+ },
+
+ "close_application": {
+ "message": "Fechando aplicativo",
+ "description": "The close application parameters"
+ },
+
+ "close_app": {
+ "message": "Aplicativo: ",
+ "description": "The close application"
+ },
+
+ "close_app_args": {
+ "message": "Argumentos: ",
+ "description": "Arguments for a close application"
+ },
+
"accounts": {
"message": "Contas",
"description": "Title for Accounts options"
diff --git a/webext/_locales/ru/messages.json b/webext/_locales/ru/messages.json
index ab8c34c..44ec014 100644
--- a/webext/_locales/ru/messages.json
+++ b/webext/_locales/ru/messages.json
@@ -34,6 +34,11 @@
"description": "Tab for Icon options"
},
+ "tab_apps": {
+ "message": "Программы",
+ "description": "Tab for Apps options"
+ },
+
"tab_mail": {
"message": "Письма",
"description": "Tab for Mail options"
@@ -304,6 +309,41 @@
"description": "The dark theme"
},
+ "apps": {
+ "message": "Программы",
+ "description": "Title for Apps options"
+ },
+
+ "start_application": {
+ "message": "Приложение при запуске",
+ "description": "The start application parameters"
+ },
+
+ "start_app": {
+ "message": "Приложение: ",
+ "description": "The start application"
+ },
+
+ "start_app_args": {
+ "message": "аргументы: ",
+ "description": "Arguments for a start application"
+ },
+
+ "close_application": {
+ "message": "Заявление о закрытии",
+ "description": "The close application parameters"
+ },
+
+ "close_app": {
+ "message": "Приложение: ",
+ "description": "The close application"
+ },
+
+ "close_app_args": {
+ "message": "аргументы: ",
+ "description": "Arguments for a close application"
+ },
+
"accounts": {
"message": "Аккаунты",
"description": "Title for Accounts options"
diff --git a/webext/background.js b/webext/background.js
index f2ec9df..f3fdbf2 100644
--- a/webext/background.js
+++ b/webext/background.js
@@ -5,6 +5,9 @@ var SysTrayX = {
startupWindowPositions: [],
hideDefaultIcon: false,
+
+ startApp: "",
+ startAppArgs: "",
};
SysTrayX.Info = {
@@ -63,6 +66,9 @@ SysTrayX.Messaging = {
// Send preferences to app
SysTrayX.Messaging.sendPreferences();
+ // Send start app trigger
+ SysTrayX.Messaging.sendStartApp();
+
// Let us wait until TB is ready, needed for TB91 and higher?
const startupDelay = await storage()
.get("startupDelay")
@@ -525,6 +531,19 @@ SysTrayX.Messaging = {
});
},
+ sendStartApp: function () {
+ SysTrayX.Link.postSysTrayXMessage({
+ startApp: SysTrayX.startApp,
+ startAppArgs: SysTrayX.startAppArgs,
+ });
+ },
+
+ sendCloseApp: function () {
+ SysTrayX.Link.postSysTrayXMessage({
+ closeApp: "closeApp",
+ });
+ },
+
sendPreferences: async function () {
await storage()
.get([
@@ -549,6 +568,10 @@ SysTrayX.Messaging = {
"countType",
"startupDelay",
"theme",
+ "startApp",
+ "startAppArgs",
+ "closeApp",
+ "closeAppArgs",
])
.then(
SysTrayX.Messaging.sendPreferencesStorage,
@@ -583,6 +606,10 @@ SysTrayX.Messaging = {
const countType = result.countType || "0";
const startupDelay = result.startupDelay || "5";
const theme = result.theme || "0";
+ const startApp = result.startApp || "";
+ const startAppArgs = result.startAppArgs || "";
+ const closeApp = result.closeApp || "";
+ const closeAppArgs = result.closeAppArgs || "";
if (theme == "0" && numberColor == "#ffffff") {
numberColor = "#000000";
@@ -614,6 +641,10 @@ SysTrayX.Messaging = {
countType,
startupDelay,
theme,
+ startApp,
+ startAppArgs,
+ closeApp,
+ closeAppArgs,
},
});
@@ -657,7 +688,7 @@ SysTrayX.Link = {
postSysTrayXMessage: function (object) {
// Send object (will be stringified by postMessage)
- console.debug("postSysTrayXMessage: " + JSON.stringify(object));
+ // console.debug("postSysTrayXMessage: " + JSON.stringify(object));
SysTrayX.Link.portSysTrayX.postMessage(object);
},
@@ -826,6 +857,34 @@ SysTrayX.Link = {
});
}
+ const startApp = response["preferences"].startApp;
+ if (startApp !== undefined) {
+ await storage().set({
+ startApp: startApp,
+ });
+ }
+
+ const startAppArgs = response["preferences"].startAppArgs;
+ if (startAppArgs !== undefined) {
+ await storage().set({
+ startAppArgs: startAppArgs,
+ });
+ }
+
+ const closeApp = response["preferences"]. closeApp;
+ if (closeApp !== undefined) {
+ await storage().set({
+ closeApp: closeApp,
+ });
+ }
+
+ const closeAppArgs = response["preferences"].closeAppArgs;
+ if (closeAppArgs !== undefined) {
+ await storage().set({
+ closeAppArgs: closeAppArgs,
+ });
+ }
+
const debug = response["preferences"].debug;
if (debug) {
await storage().set({
@@ -920,6 +979,11 @@ async function start() {
const hideDefaultIcon = await getHideDefaultIcon();
SysTrayX.hideDefaultIcon = hideDefaultIcon;
+ // Get start app launch parameters
+ const {startApp, startAppArgs} = await getStartAppParam();
+ SysTrayX.startApp = startApp;
+ SysTrayX.startAppArgs = startAppArgs;
+
// Used sync storage
// const inUse = await browser.storage.sync.getBytesInUse();
// console.log("Storage in use: " + inUse);
diff --git a/webext/css/options.css b/webext/css/options.css
index 9f11706..a9b1fcd 100644
--- a/webext/css/options.css
+++ b/webext/css/options.css
@@ -138,6 +138,22 @@ body {
padding: 10px 10px 10px 10px;
}
+#startappselect {
+ width: 25em;
+ border-style: solid;
+ border-width: 1px;
+ margin: 10px 10px 10px 10px;
+ padding: 10px 10px 10px 10px;
+}
+
+#closeappselect {
+ width: 25em;
+ border-style: solid;
+ border-width: 1px;
+ margin: 10px 10px 10px 10px;
+ padding: 10px 10px 10px 10px;
+}
+
ul,
#accountsTree {
list-style-type: none;
@@ -198,6 +214,23 @@ ul,
margin: 10px;
}
+label[id="fileDefaultIconTypeLabel"],
+label[id="fileIconTypeLabel"]
+{
+ display: inline-block;
+ padding: 8px 16px;
+ vertical-align: middle;
+ overflow: hidden;
+ text-decoration: none;
+ color: inherit;
+ background-color: #f1f1f1;
+ text-align: center;
+ cursor: pointer;
+ white-space: nowrap;
+ border: 1px solid #ccc;
+ border-radius: 8px;
+}
+
button[name="savebutton"] {
display: inline-block;
padding: 8px 16px;
diff --git a/webext/js/defaults.js b/webext/js/defaults.js
index b251c1f..63e4a72 100644
--- a/webext/js/defaults.js
+++ b/webext/js/defaults.js
@@ -286,6 +286,25 @@ async function getCountType() {
return await storage().get("countType").then(resolve, reject);
}
+//
+// Get start app parameters
+//
+async function getStartAppParam() {
+ function resolve(result) {
+ const startApp = result.startApp || "";
+ const startAppArgs = result.startAppArgs || "";
+ return { startApp, startAppArgs };
+ }
+
+ function reject() {
+ return { startApp: "", startAppArgs: "" };
+ }
+
+ return await storage()
+ .get(["startApp", "startAppArgs"])
+ .then(resolve, reject);
+}
+
// Helper funcs for TB91 and later folder handling
async function getMailFolderInfo(folder) {
diff --git a/webext/options.html b/webext/options.html
index 7f52a86..9139e0f 100644
--- a/webext/options.html
+++ b/webext/options.html
@@ -29,6 +29,7 @@
+
@@ -219,8 +220,7 @@
+
+
|