Skip to content

Commit

Permalink
Merge pull request #24 from dmitry-s93/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
dmitry-s93 authored Oct 16, 2022
2 parents 6363eb0 + dc0b486 commit 6b5adda
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 19 deletions.
8 changes: 8 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

rm -rf ../build
mkdir ../build
cd ../build

cmake ..
cmake --build .
23 changes: 23 additions & 0 deletions scripts/create_installer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash -xe

VERSION=$(grep -oP "(?<=MControlCenter VERSION )[0-9.]*" ../CMakeLists.txt)

DIST_DIR="MControlCenter-$VERSION"
APP_DIR="$DIST_DIR/app"

rm -rf $DIST_DIR
rm -f $DIST_DIR.tar.gz

mkdir $DIST_DIR
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 ./install.sh ./uninstall.sh $DIST_DIR

tar -czvf $DIST_DIR.tar.gz $DIST_DIR

rm -r $DIST_DIR
14 changes: 7 additions & 7 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SHORTCUTS_PATH='/usr/share/applications/'
DBUS_SYSTEM_PATH='/etc/dbus-1/system.d/'
DBUS_SERVICES_PATH='/usr/share/dbus-1/system-services/'

BUILD_DIR='./build/'
APP_DIR='./app/'

APP_BIN='mcontrolcenter'
SVG_ICON='mcontrolcenter.svg'
Expand All @@ -18,23 +18,23 @@ DBUS_SERVICE='mcontrolcenter.helper.service'

echo "Installation start"

cp -fv $BUILD_DIR$APP_BIN $BIN_PATH
cp -fv $APP_DIR$APP_BIN $BIN_PATH
chmod -v 755 $BIN_PATH$APP_BIN

rm -fv /home/$SUDO_USER/.local/share/applications/$SHORTCUT
cp -fv $BUILD_DIR$SHORTCUT $SHORTCUTS_PATH
cp -fv $APP_DIR$SHORTCUT $SHORTCUTS_PATH
chmod -v 644 $SHORTCUTS_PATH$SHORTCUT

cp -fv $BUILD_DIR$SVG_ICON $SCALABLE_ICONS_PATH
cp -fv $APP_DIR$SVG_ICON $SCALABLE_ICONS_PATH
chmod -v 644 $SCALABLE_ICONS_PATH$SVG_ICON

cp -fv $BUILD_DIR$HELPER_BIN $LIB_EXEC_PATH
cp -fv $APP_DIR$HELPER_BIN $LIB_EXEC_PATH
chmod -v 755 $LIB_EXEC_PATH$HELPER_BIN

cp -fv $BUILD_DIR$DBUS_CONF $DBUS_SYSTEM_PATH
cp -fv $APP_DIR$DBUS_CONF $DBUS_SYSTEM_PATH
chmod -v 644 $DBUS_SYSTEM_PATH$DBUS_CONF

cp -fv $BUILD_DIR$DBUS_SERVICE $DBUS_SERVICES_PATH
cp -fv $APP_DIR$DBUS_SERVICE $DBUS_SERVICES_PATH
chmod -v 644 $DBUS_SERVICES_PATH$DBUS_SERVICE

echo "Installation was successful"
18 changes: 9 additions & 9 deletions src/i18n/MControlCenter_ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,39 +165,39 @@
</message>
<message>
<source>rpm</source>
<translation type="unfinished"></translation>
<translation>об/мин</translation>
</message>
<message>
<source>Mode</source>
<translation type="unfinished"></translation>
<translation>Режим</translation>
</message>
<message>
<source>High Performance</source>
<translation type="unfinished"></translation>
<translation>Высокая производительность</translation>
</message>
<message>
<source>A mode that brings a balance between performance and battery live</source>
<translation type="unfinished"></translation>
<translation>Режим, обеспечивающий баланс между производительностью и временем автономной работы</translation>
</message>
<message>
<source>Silent</source>
<translation type="unfinished"></translation>
<translation>Тихий</translation>
</message>
<message>
<source>Super Battery</source>
<translation type="unfinished"></translation>
<translation>Супер батарея</translation>
</message>
<message>
<source>A mode that provides the best system performance for multi-tasking and heavy duty</source>
<translation type="unfinished"></translation>
<translation>Режим, обеспечивающий наилучшую производительность системы для многозадачности и интенсивной работы</translation>
</message>
<message>
<source>A quiet mode that lowers the fan noise</source>
<translation type="unfinished"></translation>
<translation>Тихий режим, который снижает шум вентилятора</translation>
</message>
<message>
<source>A power-saving mode that lowers the power consumption for basic needs</source>
<translation type="unfinished"></translation>
<translation>Энергосберегающий режим, который снижает энергопотребление для базовых потребностей</translation>
</message>
</context>
</TS>
15 changes: 12 additions & 3 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ MainWindow::MainWindow(QWidget *parent)
ui->setupUi(this);
// Disable debug tab
ui->tabWidget->setTabVisible(4, false);
ui->tabWidget->setDisabled(true);
setTabsEnabled(false);

if (!operate.isEcSysModuleLoaded())
operate.loadEcSysModule();
Expand All @@ -52,6 +52,15 @@ MainWindow::~MainWindow()
delete ui;
}

void MainWindow::setTabsEnabled(bool enabled)
{
ui->infoTab->setEnabled(enabled);
ui->modeTab->setEnabled(enabled);
ui->batteryTab->setEnabled(enabled);
ui->settingsTab->setEnabled(enabled);
ui->debugTab->setEnabled(enabled);
}

void MainWindow::startRealtimeUpdate()
{
realtimeUpdateTimer->start();
Expand All @@ -77,7 +86,7 @@ void MainWindow::updateData()
if (operate.updateEcData()) {
if (!isActive) {
operate.doProbe();
ui->tabWidget->setDisabled(false);
setTabsEnabled(true);
loadConfigs();
isActive= true;
}
Expand All @@ -89,7 +98,7 @@ void MainWindow::updateData()
updateFan2Speed();
updateKeyboardBrightness();
} else {
ui->tabWidget->setDisabled(true);
setTabsEnabled(false);
isActive= false;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class MainWindow : public QMainWindow
private:
Ui::MainWindow *ui;

void setTabsEnabled(bool enabled);
void startRealtimeUpdate();
void stopRealtimeUpdate();
void setUpdateInterval(int msec);
Expand Down

0 comments on commit 6b5adda

Please sign in to comment.