Browse Source

- Connection status is not a button anymore

adaptive-webui-19844
Christophe Dumez 18 years ago
parent
commit
14cd4de2c2
  1. 19
      src/GUI.cpp
  2. 1
      src/GUI.h
  3. 8
      src/MainWindow.ui

19
src/GUI.cpp

@ -76,7 +76,11 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent){ @@ -76,7 +76,11 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent){
actionClearLog->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/delete.png")));
actionPreview_file->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/preview.png")));
// actionDocumentation->setIcon(QIcon(QString::fromUtf8(":/Icons/help.png")));
actionConnexion_Status->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/disconnected.png")));
connecStatusLblIcon = new QLabel();
connecStatusLblIcon->setFrameShape(QFrame::NoFrame);
connecStatusLblIcon->setPixmap(QPixmap(QString::fromUtf8(":/Icons/skin/disconnected.png")));
connecStatusLblIcon->setToolTip(tr("<b>Connection Status:</b><br>Offline<br><i>No peers found...</i>"));
toolBar->addWidget(connecStatusLblIcon);
actionDelete_All->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/delete_all.png")));
actionTorrent_Properties->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/properties.png")));
actionCreate_torrent->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/new.png")));
@ -258,6 +262,7 @@ GUI::~GUI(){ @@ -258,6 +262,7 @@ GUI::~GUI(){
delete SearchDelegate;
delete previewProcess;
delete downloader;
delete connecStatusLblIcon;
delete s;
}
@ -1846,17 +1851,17 @@ void GUI::checkConnectionStatus(){ @@ -1846,17 +1851,17 @@ void GUI::checkConnectionStatus(){
}
if(sessionStatus.has_incoming_connections){
// Connection OK
actionConnexion_Status->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/connected.png")));
actionConnexion_Status->setText(tr("<b>Connection Status:</b><br>Online"));
connecStatusLblIcon->setPixmap(QPixmap(QString::fromUtf8(":/Icons/skin/connected.png")));
connecStatusLblIcon->setToolTip(tr("<b>Connection Status:</b><br>Online"));
}else{
if(sessionStatus.num_peers){
// Firewalled ?
actionConnexion_Status->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/firewalled.png")));
actionConnexion_Status->setText(tr("<b>Connection Status:</b><br>Firewalled?<br><i>No incoming connections...</i>"));
connecStatusLblIcon->setPixmap(QPixmap(QString::fromUtf8(":/Icons/skin/firewalled.png")));
connecStatusLblIcon->setToolTip(tr("<b>Connection Status:</b><br>Firewalled?<br><i>No incoming connections...</i>"));
}else{
// Disconnected
actionConnexion_Status->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/disconnected.png")));
actionConnexion_Status->setText(tr("<b>Connection Status:</b><br>Offline<br><i>No peers found...</i>"));
connecStatusLblIcon->setPixmap(QPixmap(QString::fromUtf8(":/Icons/skin/disconnected.png")));
connecStatusLblIcon->setToolTip(tr("<b>Connection Status:</b><br>Offline<br><i>No peers found...</i>"));
}
}
// Check trackerErrors list size and clear it if it is too big

1
src/GUI.h

@ -85,6 +85,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{ @@ -85,6 +85,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
SearchListDelegate *SearchDelegate;
QStringList supported_preview_extensions;
unsigned int nbTorrents;
QLabel *connecStatusLblIcon;
// Preview
previewSelect *previewSelection;
QProcess *previewProcess;

8
src/MainWindow.ui

@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
<x>0</x>
<y>0</y>
<width>849</width>
<height>553</height>
<height>576</height>
</rect>
</property>
<property name="contextMenuPolicy" >
@ -797,7 +797,6 @@ @@ -797,7 +797,6 @@
<addaction name="actionOptions" />
<addaction name="actionExit" />
<addaction name="separator" />
<addaction name="actionConnexion_Status" />
</widget>
<action name="actionOpen" >
<property name="text" >
@ -849,11 +848,6 @@ @@ -849,11 +848,6 @@
<string>Documentation</string>
</property>
</action>
<action name="actionConnexion_Status" >
<property name="text" >
<string>Connection Status</string>
</property>
</action>
<action name="actionDelete_All" >
<property name="text" >
<string>Delete All</string>

Loading…
Cancel
Save