Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
- Now logfile will open ad the end and not beginning
- New button in driver section that opens nvidia-settings if nvidia is running
  • Loading branch information
simopil committed Feb 11, 2019
1 parent 60998ff commit 74b338c
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 23 deletions.
Binary file modified bin/suseprimeqt
Binary file not shown.
8 changes: 4 additions & 4 deletions src/logout_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ logout_info::~logout_info()
delete ui;
}

void logout_info::on_pushButton_clicked()
void logout_info::on_logout_abort_but_clicked()
{
QProcess* abort_switch = new QProcess();
abort_switch->start("pkexec killall prime-select");
this->close();
}

void logout_info::on_pushButton_2_clicked()
void logout_info::on_logout_but_clicked()
{
QProcess* abort_switch = new QProcess();
abort_switch->start("pkexec killall prime-select");
this->close();
}
5 changes: 3 additions & 2 deletions src/logout_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ class logout_info : public QDialog
~logout_info();

private slots:
void on_pushButton_clicked();

void on_pushButton_2_clicked();
void on_logout_abort_but_clicked();

void on_logout_but_clicked();

private:
Ui::logout_info *ui;
Expand Down
7 changes: 5 additions & 2 deletions src/logout_info.ui
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
<property name="windowTitle">
<string>Info</string>
</property>
<property name="locale">
<locale language="English" country="UnitedStates"/>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
Expand All @@ -34,7 +37,7 @@
<string>Please logout to switch graphics</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton">
<widget class="QPushButton" name="logout_but">
<property name="geometry">
<rect>
<x>70</x>
Expand All @@ -50,7 +53,7 @@
<string>OK</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_2">
<widget class="QPushButton" name="logout_abort_but">
<property name="geometry">
<rect>
<x>270</x>
Expand Down
14 changes: 11 additions & 3 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ void MainWindow::refresh()
logfile.close();
ui->logViewer->setLineWrapMode(QTextEdit::NoWrap);
ui->logViewer->setText(log);
ui->logViewer->moveCursor(QTextCursor::End);
ui->logcleaner_but->setEnabled(true);
} else {
ui->logViewer->setText("logfile /var/log/prime-select.log NOT exist! Probably cleaned by user");
Expand Down Expand Up @@ -71,9 +72,9 @@ void MainWindow::refresh()
driver = current_drvstream.readAll();
ui->driverStatus->setText(driver);
QString currmsg = "driver already in use";
if( driver.contains("intel2", Qt::CaseSensitive) ) { ui->switchIntel2->setEnabled(false); ui->switchIntel2->setToolTip("intel2 driver already in use"); }
else if( driver.contains("intel", Qt::CaseSensitive) ) { ui->switchIntel->setEnabled(false); ui->switchIntel->setToolTip("intel driver already in use"); }
else if( driver.contains("nvidia", Qt::CaseSensitive) ) { ui->switchNvidia->setEnabled(false); ui->switchNvidia->setToolTip("nvidia driver already in use"); }
if( driver.contains("intel2", Qt::CaseSensitive) ) { ui->switchIntel2->setEnabled(false); ui->switchIntel2->setToolTip("intel2 driver already in use"); ui->nvidiasettings_but->setEnabled(false); }
else if( driver.contains("intel", Qt::CaseSensitive) ) { ui->switchIntel->setEnabled(false); ui->switchIntel->setToolTip("intel driver already in use"); ui->nvidiasettings_but->setEnabled(false); }
else if( driver.contains("nvidia", Qt::CaseSensitive) ) { ui->switchNvidia->setEnabled(false); ui->switchNvidia->setToolTip("nvidia driver already in use"); ui->nvidiasettings_but->setEnabled(true); }
} else {
ui->driverStatus->setText("<font color=\"red\">NOT SET</font>");
}
Expand Down Expand Up @@ -187,6 +188,7 @@ MainWindow::MainWindow(QWidget *parent) :
ui->nextboot_widget->setToolTip("Select card only for next boot, default card setting will not change");
ui->service_widget->setToolTip("Manage the service. Remember SUSEPrime needs service enabled to correctly work");
ui->unsetButton->setToolTip("Disable service and reset configuration of SUSEPrime");
ui->nvidiasettings_but->setToolTip("Open nvidia-settings panel");
//refresh_and_set_tab
MainWindow::refresh();
ui->tabWidget->setCurrentIndex(0);
Expand Down Expand Up @@ -323,3 +325,9 @@ void MainWindow::on_logcleaner_but_clicked()
ui->commandout->append(output);
MainWindow::refresh();
}

void MainWindow::on_nvidiasettings_but_clicked()
{
QProcess* nvidia_settings_proc = new QProcess();
nvidia_settings_proc->start("nvidia-settings");
}
2 changes: 2 additions & 0 deletions src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ private slots:

void on_logcleaner_but_clicked();

void on_nvidiasettings_but_clicked();

private:
Ui::MainWindow *ui;
void refresh();
Expand Down
37 changes: 25 additions & 12 deletions src/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@
<property name="geometry">
<rect>
<x>-10</x>
<y>50</y>
<y>40</y>
<width>140</width>
<height>30</height>
</rect>
Expand Down Expand Up @@ -324,6 +324,19 @@
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QPushButton" name="nvidiasettings_but">
<property name="geometry">
<rect>
<x>17</x>
<y>85</y>
<width>88</width>
<height>34</height>
</rect>
</property>
<property name="text">
<string>Settings</string>
</property>
</widget>
</widget>
</item>
<item row="0" column="2">
Expand Down Expand Up @@ -352,10 +365,10 @@
</property>
<property name="geometry">
<rect>
<x>32</x>
<y>50</y>
<width>50</width>
<height>30</height>
<x>30</x>
<y>35</y>
<width>60</width>
<height>40</height>
</rect>
</property>
<property name="sizePolicy">
Expand All @@ -366,20 +379,20 @@
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>30</height>
<width>60</width>
<height>40</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>30</height>
<width>60</width>
<height>40</height>
</size>
</property>
<property name="font">
<font>
<family>Droid Sans Japanese</family>
<pointsize>20</pointsize>
<pointsize>25</pointsize>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
Expand All @@ -402,8 +415,8 @@
<widget class="QLabel" name="bbs_label">
<property name="geometry">
<rect>
<x>23</x>
<y>92</y>
<x>25</x>
<y>90</y>
<width>71</width>
<height>16</height>
</rect>
Expand Down

0 comments on commit 74b338c

Please sign in to comment.