Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
*.a
*.lib

# Compiled linguistic files
*.qm

# Executables
*.exe
*.out
Expand Down
1 change: 1 addition & 0 deletions docs/tested_devices.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
| MSI GF65 Thin 10SDR | E16W1IMS.50C 11/19/2020 | ❌ Mode (everything's greyed out)<br> ✔ Battery Limit<br> ✔ Cooler Boost<br> ✔ Fan Control | ❌ Keyboard Backlit (greyed out)<br> ❓ FN -> Super (Not greyed out, but doesn't affect anything when ticked)<br> ✔ Webcam<br> ❌ USB Power Share (greyed out) |
| MSI Modern 15 B5M | 15HKEMS1.103 06/29/2022 | ❌ Mode (everything's greyed out)<br> ❓ Battery Limit<br> ✔ Cooler Boost<br> ❓ Fan Control | ❌ Keyboard Backlit (greyed out)<br> ❓ FN -> Super (Not greyed out, but doesn't affect anything when ticked)<br> ✔ Webcam<br> ❓ USB Power Share |
| MSI Katana GF66 12UD | 1584EMS1.110 06/21/2022 | ✔ Mode<br> ✔ Battery Limit<br> ✔ Cooler Boost<br> ✔ Fan Control | ✔ Keyboard Backlit<br> ✔ FN -> Super<br> ✔ Webcam<br> ✔ USB Power Share |
| MSI Katana GF66 12UG | 1583EMS1.109 03/29/2026 | ✔ Mode<br> ✔ Battery Limit<br> ✔ Cooler Boost<br> ✔ Fan Control | ✔ Keyboard Backlit<br> ✔ FN -> Super<br> ✔ Webcam<br> ✔ USB Power Share |
| MSI Summit E14Evo A12M | 1594EMS1.118 03/22/2023 | ✔ Mode<br> ✔ Battery Limit<br> ✔ Cooler Boost<br> ✔ Fan Control | ✔ Keyboard Backlit<br> ✔ FN -> Super<br> ✔ Webcam<br> ✔ USB Power Share |
| MSI Summit E14 Flip Evo A12MT | 14F1EMS1.115 09/13/2022 | ✔ Mode<br> ✔ Battery Limit<br> ✔ Cooler Boost<br> ❌ Fan Control | ✔ Keyboard Backlit<br> ✔ FN -> Super<br> ✔ Webcam<br> ✔ USB Power Share |
| MSI Delta 15 A5EFK | 15CKEMS1.108 02/09/2021 | ❌ Mode (everything's greyed out)<br> ✔ Battery Limit<br> ✔ Cooler Boost<br> ✔ Fan Control | ❌ Keyboard Backlit<br> ❓ FN -> Super (Not greyed out, but doesn't affect anything when ticked)<br> ✔ Webcam<br> ❌ USB Power Share (greyed out)|
Expand Down
82 changes: 82 additions & 0 deletions resources/mcontrolcenter-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion scripts/create_installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mkdir $APP_DIR
cp ../build/mcontrolcenter $APP_DIR
cp ../build/helper/mcontrolcenter-helper $APP_DIR
cp ../src/helper/mcontrolcenter-helper.conf ../src/helper/mcontrolcenter.helper.service $APP_DIR
cp ../resources/mcontrolcenter.desktop ../resources/mcontrolcenter.svg $APP_DIR
cp ../resources/mcontrolcenter.desktop ../resources/mcontrolcenter.svg ../resources/mcontrolcenter-symbolic.svg $APP_DIR

cp ./install.sh ./uninstall.sh $DIST_DIR

Expand Down
3 changes: 2 additions & 1 deletion scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ APP_DIR='./app/'

APP_BIN='mcontrolcenter'
SVG_ICON='mcontrolcenter.svg'
SVG_ICON_MC='mcontrolcenter-symbolic.svg'
SHORTCUT='mcontrolcenter.desktop'
HELPER_BIN='mcontrolcenter-helper'
DBUS_CONF='mcontrolcenter-helper.conf'
Expand All @@ -24,6 +25,7 @@ rm -fv /home/$SUDO_USER/.local/share/applications/$SHORTCUT
install -vDm644 $APP_DIR$SHORTCUT $SHORTCUTS_PATH$SHORTCUT

install -vDm644 $APP_DIR$SVG_ICON $SCALABLE_ICONS_PATH$SVG_ICON
install -vDm644 $APP_DIR$SVG_ICON_MC $SCALABLE_ICONS_PATH$SVG_ICON_MC

install -vDm755 $APP_DIR$HELPER_BIN $LIB_EXEC_PATH$HELPER_BIN

Expand All @@ -32,4 +34,3 @@ install -vDm644 $APP_DIR$DBUS_CONF $DBUS_SYSTEM_PATH$DBUS_CONF
install -vDm644 $APP_DIR$DBUS_SERVICE $DBUS_SERVICES_PATH$DBUS_SERVICE

echo "Installation was successful"

1 change: 1 addition & 0 deletions scripts/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ rm -fv /usr/bin/mcontrolcenter
rm -fv /usr/share/applications/$SHORTCUT
rm -fv /home/$SUDO_USER/.local/share/applications/$SHORTCUT
rm -fv /usr/share/icons/hicolor/scalable/apps/mcontrolcenter.svg
rm -fv /usr/share/icons/hicolor/scalable/apps/mcontrolcenter-symbolic.svg
rm -fv /usr/libexec/mcontrolcenter-helper
rm -fv /etc/dbus-1/system.d/mcontrolcenter-helper.conf
rm -fv /usr/share/dbus-1/system.d/mcontrolcenter-helper.conf
Expand Down
4 changes: 4 additions & 0 deletions src/i18n/MControlCenter_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ Make sure that either Power Profiles Daemon or TuneD is installed and restart th
<source>MSI-EC Status:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Symbolic tray icon:</source>
<translation>Symbolic tray icon:</translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:700;&quot;&gt;Warning&lt;/span&gt;: Writing the wrong values to the wrong addresses &lt;span style=&quot; font-weight:700;&quot;&gt;WILL BRICK YOUR DEVICE!&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:700;&quot;&gt;Never&lt;/span&gt; write to EC memory without knowing how to do a proper &lt;span style=&quot; font-weight:700;&quot;&gt;BIOS/EC&lt;/span&gt; reset, keep in mind that a reset &lt;span style=&quot; font-weight:700;&quot;&gt;might not&lt;/span&gt; fix the device if the device got bricked/broken. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
Expand Down
4 changes: 4 additions & 0 deletions src/i18n/MControlCenter_it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@
<source>MSI-EC Status:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Symbolic tray icon:</source>
<translation>Usa icona simbolica:</translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:700;&quot;&gt;Warning&lt;/span&gt;: Writing the wrong values to the wrong addresses &lt;span style=&quot; font-weight:700;&quot;&gt;WILL BRICK YOUR DEVICE!&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:700;&quot;&gt;Never&lt;/span&gt; write to EC memory without knowing how to do a proper &lt;span style=&quot; font-weight:700;&quot;&gt;BIOS/EC&lt;/span&gt; reset, keep in mind that a reset &lt;span style=&quot; font-weight:700;&quot;&gt;might not&lt;/span&gt; fix the device if the device got bricked/broken. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
Expand Down
Binary file removed src/images/mcontrolcenter.png
Binary file not shown.
19 changes: 15 additions & 4 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ MainWindow::MainWindow(QWidget *parent)
if (s.isValueExist("MainWindow/Width") && s.isValueExist("MainWindow/Height"))
MainWindow::resize(s.getValue("MainWindow/Width").toInt(), s.getValue("MainWindow/Height").toInt());

createTrayIcon();
bool useSymbolicIcon = s.getValue("Settings/symbolicTrayIcon").toBool();
createTrayIcon(useSymbolicIcon);

ui->tabWidget->tabBar()->setExpanding(true);
// Disable debug tab
Expand Down Expand Up @@ -181,6 +182,7 @@ MainWindow::MainWindow(QWidget *parent)
ui->userModeOnBatteryComboBox->setCurrentIndex(s.getValue("Settings/UserModeOnBattery").toInt());
ui->userModeOnChargerComboBox->setCurrentIndex(s.getValue("Settings/UserModeOnCharger").toInt());
ui->autoPPDCheckBox->setChecked(s.getValue("Settings/autoPPDstate").toBool());
ui->symbolicTrayIconCheckBox->setChecked(s.getValue("Settings/symbolicTrayIcon").toBool());
}

MainWindow::~MainWindow() {
Expand Down Expand Up @@ -902,6 +904,16 @@ void MainWindow::on_superBatteryModeRadioButton_toggled(bool checked) {
setSuperBatteryMode();
}

void MainWindow::on_symbolicTrayIconCheckBox_toggled(bool checked) {
Settings::setValue("Settings/symbolicTrayIcon", checked);
if (trayIcon) {
if (checked)
trayIcon->setIcon(QIcon(":/images/AppIconSymbolic"));
else
trayIcon->setIcon(QIcon(":/images/AppIcon"));
}
}

void MainWindow::iconActivated(QSystemTrayIcon::ActivationReason reason) {
switch (reason) {
case QSystemTrayIcon::Trigger:
Expand All @@ -918,7 +930,7 @@ void MainWindow::iconActivated(QSystemTrayIcon::ActivationReason reason) {
}
}

void MainWindow::createTrayIcon() {
void MainWindow::createTrayIcon(bool useSymbolicIcon) {
createActions();

modeTrayMenu = new QMenu(tr("Mode"));
Expand Down Expand Up @@ -955,8 +967,7 @@ void MainWindow::createTrayIcon() {

trayIcon = new QSystemTrayIcon(this);
trayIcon->setContextMenu(trayIconMenu);
auto icon = QIcon(":/images/AppIcon");
trayIcon->setIcon(icon);
trayIcon->setIcon(useSymbolicIcon ? QIcon(":/images/AppIconSymbolic") : QIcon(":/images/AppIcon"));
trayIcon->setToolTip("MControlCenter");

trayIcon->show();
Expand Down
3 changes: 2 additions & 1 deletion src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Q_OBJECT
qint64 timeLastWatcherInterval = 0;
void timerSleepTimeout();

void createTrayIcon();
void createTrayIcon(bool useSymbolicIcon);
void createActions();
void iconActivated(QSystemTrayIcon::ActivationReason reason);
void saveStateRequest(QSessionManager &sessionManager);
Expand Down Expand Up @@ -125,6 +125,7 @@ private slots:
void on_ChargerStateChange(bool isCharging);
void on_PowerProfileChange(const PowerProfile profile);

void on_symbolicTrayIconCheckBox_toggled(bool checked);
void on_bestMobilityRadioButton_toggled(bool checked);
void on_balancedBatteryRadioButton_toggled(bool checked);
void on_bestBatteryRadioButton_toggled(bool checked);
Expand Down
32 changes: 23 additions & 9 deletions src/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1994,15 +1994,29 @@
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="ecBuildValueLabel">
<property name="text">
<string notr="true">-</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="1">
<widget class="QLabel" name="ecBuildValueLabel">
<property name="text">
<string notr="true">-</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="symbolicTrayIconLabel">
<property name="text">
<string>Symbolic tray icon:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="symbolicTrayIconCheckBox">
<property name="text">
<string />
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="1">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
Expand Down
3 changes: 2 additions & 1 deletion src/resources.qrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<RCC>
<qresource prefix="/images">
<file alias="AppIcon">images/mcontrolcenter.png</file>
<file alias="AppIcon">../resources/mcontrolcenter.svg</file>
<file alias="AppIconSymbolic">../resources/mcontrolcenter-symbolic.svg</file>
</qresource>
<qresource prefix="/translations">
<file alias="lang_de_DE">i18n/MControlCenter_de_DE.qm</file>
Expand Down