Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
Add 'Return to host' button to JailIndicator. Thanks Dru for report. …
Browse files Browse the repository at this point in the history
…May close #905
  • Loading branch information
yurkis committed Jan 9, 2014
1 parent f353da8 commit 97f4aeb
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src-qt4/pc-updatecenter/jailindicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ void JailIndicator::setJailName(QString name)
{
ui->jailNameLabel->setText(name);
}

void JailIndicator::on_returnToHostBtn_clicked()
{
emit (returnToHost());
}
6 changes: 6 additions & 0 deletions src-qt4/pc-updatecenter/jailindicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ class JailIndicator : public QWidget
~JailIndicator();

void setJailName(QString name);

signals:
void returnToHost();

private slots:
void on_returnToHostBtn_clicked();

private:
Ui::JailIndicator *ui;
};
Expand Down
9 changes: 8 additions & 1 deletion src-qt4/pc-updatecenter/jailindicator.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>398</width>
<height>44</height>
<height>50</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -75,6 +75,13 @@
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="returnToHostBtn">
<property name="text">
<string>Return to host</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
Expand Down
10 changes: 10 additions & 0 deletions src-qt4/pc-updatecenter/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ void MainWindow::init()
connect(&mPBIController, SIGNAL(stateChanged(CAbstractUpdateController::EUpdateControllerState)),
this, SLOT(globalStateChanged(CAbstractUpdateController::EUpdateControllerState)));

connect(ui->jailIndicatorWidget, SIGNAL(returnToHost()),
this, SLOT(slotReturnToHost()));


ui->mainStatesStack->setCurrentIndex(MAIN_INDICATORS_IDX);

Expand Down Expand Up @@ -282,6 +285,13 @@ void MainWindow::globalStateChanged(CAbstractUpdateController::EUpdateController
Q_UNUSED(new_state)
}

///////////////////////////////////////////////////////////////////////////////
void MainWindow::slotReturnToHost()
{
mJail.setJailEnabled(false);
jailRefresh();
}

///////////////////////////////////////////////////////////////////////////////
void MainWindow::on_updateAllButton_clicked()
{
Expand Down
3 changes: 2 additions & 1 deletion src-qt4/pc-updatecenter/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public slots:
private slots:

void globalStateChanged(CAbstractUpdateController::EUpdateControllerState new_state);
void slotReturnToHost();

private slots:

Expand All @@ -80,7 +81,7 @@ private slots:
void on_actionExit_triggered();
void on_actionJail_triggered();
void on_actionSystem_branches_triggered();
void on_actionUpdate_set_triggered();
void on_actionUpdate_set_triggered();
};

#endif // MAINWINDOW_H

0 comments on commit 97f4aeb

Please sign in to comment.