Merge pull request #1620 from csoler/v0.6-ImprovedGUI

V0.6 improved gui
This commit is contained in:
csoler 2019-08-26 19:07:29 +02:00 committed by GitHub
commit acdc8089ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 90 additions and 38 deletions

View File

@ -22,6 +22,7 @@
#include <QPixmap>
#include <QCloseEvent>
#include <QMenu>
#include "PopupChatWindow.h"
#include "ChatDialog.h"
@ -75,21 +76,30 @@ PopupChatWindow::PopupChatWindow(bool tabbed, QWidget *parent, Qt::WindowFlags f
ui.tabWidget->setVisible(tabbedWindow);
if (Settings->getChatFlags() & RS_CHAT_TABBED_WINDOW) {
ui.actionDockTab->setVisible(tabbedWindow == false);
ui.actionUndockTab->setVisible(tabbedWindow);
} else {
ui.actionDockTab->setVisible(false);
ui.actionUndockTab->setVisible(false);
}
// if (Settings->getChatFlags() & RS_CHAT_TABBED_WINDOW) {
// ui.actionDockTab->setVisible(tabbedWindow == false);
// ui.actionUndockTab->setVisible(tabbedWindow);
// } else {
// ui.actionDockTab->setVisible(false);
// ui.actionUndockTab->setVisible(false);
//
// }
// ui.actionAvatar->setVisible(false); // removed because it is already handled by clicking on your own avatar.
// ui.actionSetOnTop->setVisible(false);// removed, because the window manager should handle this already.
// ui.actionColor->setVisible(false);// moved to the context menu
ui.chattoolBar->hide(); // no widgets left!
setAttribute(Qt::WA_DeleteOnClose, true);
connect(ui.actionAvatar, SIGNAL(triggered()),this, SLOT(getAvatar()));
connect(ui.actionColor, SIGNAL(triggered()), this, SLOT(setStyle()));
connect(ui.actionDockTab, SIGNAL(triggered()), this, SLOT(dockTab()));
connect(ui.actionUndockTab, SIGNAL(triggered()), this, SLOT(undockTab()));
connect(ui.actionSetOnTop, SIGNAL(toggled(bool)), this, SLOT(setOnTop()));
// connect(ui.actionAvatar, SIGNAL(triggered()),this, SLOT(getAvatar()));
// connect(ui.actionColor, SIGNAL(triggered()), this, SLOT(setStyle()));
// connect(ui.actionDockTab, SIGNAL(triggered()), this, SLOT(dockTab()));
// connect(ui.actionUndockTab, SIGNAL(triggered()), this, SLOT(undockTab()));
// connect(ui.actionSetOnTop, SIGNAL(toggled(bool)), this, SLOT(setOnTop()));
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint)));
connect(ui.tabWidget, SIGNAL(tabChanged(ChatDialog*)), this, SLOT(tabChanged(ChatDialog*)));
connect(ui.tabWidget, SIGNAL(tabClosed(ChatDialog*)), this, SLOT(tabClosed(ChatDialog*)));
@ -102,6 +112,21 @@ PopupChatWindow::PopupChatWindow(bool tabbed, QWidget *parent, Qt::WindowFlags f
}
}
void PopupChatWindow::showContextMenu(QPoint)
{
QMenu contextMnu(this);
contextMnu.addAction(QIcon(":/images/highlight.png"),tr("Choose window color..."),this,SLOT(setStyle()));
if (Settings->getChatFlags() & RS_CHAT_TABBED_WINDOW)
{
if(tabbedWindow)
contextMnu.addAction(QIcon(":/images/tab-dock.png"),tr("Dock window"),this,SLOT(docTab()));
contextMnu.addAction(QIcon(":/images/tab-undock.png"),tr("Dock window"),this,SLOT(undockTab()));
}
contextMnu.exec(QCursor::pos());
}
/** Destructor. */
PopupChatWindow::~PopupChatWindow()
{

View File

@ -55,6 +55,7 @@ protected:
void closeEvent(QCloseEvent *event);
private slots:
void setStyle();
void getAvatar();
void tabChanged(ChatDialog *dialog);
void tabInfoChanged(ChatDialog *dialog);
@ -63,9 +64,9 @@ private slots:
void dialogClose(ChatDialog *dialog);
void dockTab();
void undockTab();
void setStyle();
void setOnTop();
void blink(bool on);
void showContextMenu(QPoint p);
private:
bool tabbedWindow;

View File

@ -10,6 +10,9 @@
<height>451</height>
</rect>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="windowTitle">
<string notr="true">MainWindow</string>
</property>

View File

@ -183,6 +183,14 @@ void ConnectProgressDialog::initDialog()
ui->UdpResult->hide();
ui->UdpProgressBar->hide();
ui->UdpLabel->hide();
ui->DhtLabel->hide();
ui->DhtProgressBar->hide();
ui->DhtResult->hide();
ui->LookupLabel->hide();
ui->LookupProgressBar->hide();
ui->LookupResult->hide();
}
else
{

View File

@ -187,9 +187,6 @@ MessagesDialog::MessagesDialog(QWidget *parent)
//setting default filter by column as subject
ui.filterLineEdit->setCurrentFilter(RsMessageModel::COLUMN_THREAD_SUBJECT);
// load settings
processSettings(true);
///////////////////////////////////////////////////////////////////////////////////////
// Post "load settings" actions (which makes sure they are not affected by settings) //
///////////////////////////////////////////////////////////////////////////////////////
@ -234,6 +231,9 @@ MessagesDialog::MessagesDialog(QWidget *parent)
// fill quick view
fillQuickView();
// load settings
processSettings(true);
//ui.messageTreeWidget->installEventFilter(this);
// remove close button of the the first tab
@ -345,9 +345,8 @@ void MessagesDialog::processSettings(bool load)
ui.filterLineEdit->setCurrentFilter(Settings->value("filterColumn", RsMessageModel::COLUMN_THREAD_SUBJECT).toInt());
// state of message tree
if (Settings->value("MessageTreeVersion").toInt() == messageTreeVersion) {
if (Settings->value("MessageTreeVersion").toInt() == messageTreeVersion)
msgwheader->restoreState(Settings->value("MessageTree").toByteArray());
}
// state of splitter
ui.msgSplitter->restoreState(Settings->value("SplitterMsg").toByteArray());

View File

@ -81,6 +81,13 @@ GeneralPage::GeneralPage(QWidget * parent, Qt::WindowFlags flags) :
ui.checkCloseToTray->setChecked(false) ; // default should be false because some systems to not support this.
if(!QSystemTrayIcon::isSystemTrayAvailable())
{
ui.checkCloseToTray->setChecked(false) ; // default should be false because some systems to not support this.
ui.checkCloseToTray->setToolTip(tr("No Qt-compatible system tray was found on this system."));
Settings->setCloseToTray(false);
}
/* Connect signals */
connect(ui.useLocalServer, SIGNAL(toggled(bool)), this,SLOT(updateUseLocalServer())) ;
connect(ui.idleSpinBox, SIGNAL(valueChanged(int)), this,SLOT(updateMaxTimeBeforeIdle())) ;

View File

@ -81,27 +81,35 @@ ServerPage::ServerPage(QWidget * parent, Qt::WindowFlags flags)
manager = NULL ;
if(RsAccounts::isTorAuto())
if(RsAccounts::isHiddenNode())
{
// Here we use absolute numbers instead of consts defined above, because the consts correspond to the tab number *after* this tab removal.
if(RsAccounts::isTorAuto())
{
// Here we use absolute numbers instead of consts defined above, because the consts correspond to the tab number *after* this tab removal.
ui.tabWidget->removeTab(TAB_RELAYS) ; // remove relays. Not useful in Tor mode.
ui.tabWidget->removeTab(TAB_IP_FILTERS) ; // remove IP filters. Not useful in Tor mode.
ui.tabWidget->removeTab(TAB_RELAYS) ; // remove relays. Not useful in Tor mode.
ui.tabWidget->removeTab(TAB_IP_FILTERS) ; // remove IP filters. Not useful in Tor mode.
ui.hiddenServiceTab->removeTab(TAB_HIDDEN_SERVICE_I2P_BOB) ; // remove the Automatic I2P/BOB tab
ui.hiddenServiceTab->removeTab(TAB_HIDDEN_SERVICE_I2P_BOB) ; // remove the Automatic I2P/BOB tab
ui.hiddenpage_proxyAddress_i2p->hide() ;
ui.hiddenpage_proxyLabel_i2p->hide() ;
ui.hiddenpage_proxyPort_i2p->hide() ;
ui.label_i2p_outgoing->hide() ;
ui.iconlabel_i2p_outgoing->hide() ;
ui.plainTextEdit->hide() ;
ui.hiddenpage_configuration->hide() ;
ui.l_hiddenpage_configuration->hide() ;
ui.hiddenpageInHelpPlainTextEdit->hide() ;
ui.hiddenpage_proxyAddress_i2p->hide() ;
ui.hiddenpage_proxyLabel_i2p->hide() ;
ui.hiddenpage_proxyPort_i2p->hide() ;
ui.label_i2p_outgoing->hide() ;
ui.iconlabel_i2p_outgoing->hide() ;
ui.plainTextEdit->hide() ;
ui.hiddenpage_configuration->hide() ;
ui.l_hiddenpage_configuration->hide() ;
ui.hiddenpageInHelpPlainTextEdit->hide() ;
ui.hiddenpage_outHeader->setText(tr("Tor has been automatically configured by Retroshare. You shouldn't need to change anything here.")) ;
ui.hiddenpage_inHeader->setText(tr("Tor has been automatically configured by Retroshare. You shouldn't need to change anything here.")) ;
ui.hiddenpage_outHeader->setText(tr("Tor has been automatically configured by Retroshare. You shouldn't need to change anything here.")) ;
ui.hiddenpage_inHeader->setText(tr("Tor has been automatically configured by Retroshare. You shouldn't need to change anything here.")) ;
}
}
else
{
ui.hiddenServiceTab->removeTab(TAB_HIDDEN_SERVICE_I2P_BOB); // warning: the order of operation here is very important.
ui.hiddenServiceTab->removeTab(TAB_HIDDEN_SERVICE_INCOMING);
}
ui.filteredIpsTable->setHorizontalHeaderItem(COLUMN_RANGE,new QTableWidgetItem(tr("IP Range"))) ;

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>1283</width>
<height>917</height>
<height>929</height>
</rect>
</property>
<layout class="QVBoxLayout" name="ServerPageVLayout">
@ -26,7 +26,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="tabNetConf">
<attribute name="title">
@ -539,7 +539,7 @@ behind a firewall or a VPN.</string>
</sizepolicy>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="hiddenServiceTabManual">
<attribute name="title">
@ -549,7 +549,7 @@ behind a firewall or a VPN.</string>
<item>
<widget class="QLabel" name="hiddenpage_outHeader">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Configure your Tor and I2P SOCKS proxy here. &lt;br/&gt;If you prefer to use BOB to automatically manage I2P check the other tab.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Configure your Tor and I2P SOCKS proxy here. It will allow you to also connect &lt;/p&gt;&lt;p&gt;to hidden nodes.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>

View File

@ -66,6 +66,7 @@ void HashingStatus::updateHashingInfo(const QString& s)
{
statusHashing->hide() ;
hashloader->hide() ;
setToolTip(QString());
movie->stop() ;
} else {