tested/fixed all option buttons

This commit is contained in:
csoler 2017-01-31 23:07:59 +01:00
parent a357c52124
commit 79ef4031f7
6 changed files with 111 additions and 138 deletions

View File

@ -31,6 +31,7 @@
#include "AppearancePage.h" #include "AppearancePage.h"
#include "rsharesettings.h" #include "rsharesettings.h"
#include "gui/MainWindow.h" #include "gui/MainWindow.h"
#include "gui/notifyqt.h"
#include "gui/statusbar/peerstatus.h" #include "gui/statusbar/peerstatus.h"
#include "gui/statusbar/natstatus.h" #include "gui/statusbar/natstatus.h"
#include "gui/statusbar/dhtstatus.h" #include "gui/statusbar/dhtstatus.h"
@ -90,9 +91,10 @@ AppearancePage::AppearancePage(QWidget * parent, Qt::WindowFlags flags)
connect(ui.cmboLanguage, SIGNAL(currentIndexChanged(int)), this, SLOT(updateLanguageCode() )); connect(ui.cmboLanguage, SIGNAL(currentIndexChanged(int)), this, SLOT(updateLanguageCode() ));
connect(ui.cmboStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(updateInterfaceStyle() )); connect(ui.cmboStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(updateInterfaceStyle() ));
connect(ui.cmboStyleSheet, SIGNAL(currentIndexChanged(int)), this, SLOT(updateSheetName() )); connect(ui.cmboStyleSheet, SIGNAL(currentIndexChanged(int)), this, SLOT(updateSheetName() ));
connect(ui.rbtPageOnToolBar, SIGNAL(toggled(bool)), this, SLOT(updateRbtPageOnToolBar() ));
connect(ui.rbtActionOnToolBar, SIGNAL(toggled(bool)), this, SLOT(updateActionButtonLoc() ));
connect(ui.checkBoxDisableSysTrayToolTip, SIGNAL(toggled(bool)), this, SLOT(updateStatusToolTip() )); connect(ui.checkBoxDisableSysTrayToolTip, SIGNAL(toggled(bool)), this, SLOT(updateStatusToolTip() ));
connect(ui.mainPageButtonType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(updateRbtPageOnToolBar() ));
connect(ui.menuItemsButtonType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(updateActionButtonLoc() ));
} }
void AppearancePage::switch_status_grpStatus(bool b) { switch_status(MainWindow::StatusGrpStatus ,"ShowStatusBar", b) ; } void AppearancePage::switch_status_grpStatus(bool b) { switch_status(MainWindow::StatusGrpStatus ,"ShowStatusBar", b) ; }
@ -128,8 +130,16 @@ void AppearancePage::updateInterfaceStyle()
Settings->setInterfaceStyle(ui.cmboStyle->currentText()); Settings->setInterfaceStyle(ui.cmboStyle->currentText());
} }
void AppearancePage::updateSheetName() { Settings->setSheetName(ui.cmboStyleSheet->itemData(ui.cmboStyleSheet->currentIndex()).toString()); } void AppearancePage::updateSheetName() { Settings->setSheetName(ui.cmboStyleSheet->itemData(ui.cmboStyleSheet->currentIndex()).toString()); }
void AppearancePage::updateRbtPageOnToolBar() { Settings->setPageButtonLoc(ui.rbtPageOnToolBar->isChecked());} void AppearancePage::updateRbtPageOnToolBar()
void AppearancePage::updateActionButtonLoc() { Settings->setActionButtonLoc(ui.rbtActionOnToolBar->isChecked()); } {
Settings->setPageButtonLoc(!ui.mainPageButtonType_CB->currentIndex());
NotifyQt::getInstance()->notifySettingsChanged();
}
void AppearancePage::updateActionButtonLoc()
{
Settings->setActionButtonLoc(!ui.menuItemsButtonType_CB->currentIndex());
NotifyQt::getInstance()->notifySettingsChanged();
}
void AppearancePage::updateStatusToolTip() { MainWindow::getInstance()->toggleStatusToolTip(ui.checkBoxDisableSysTrayToolTip->isChecked()); } void AppearancePage::updateStatusToolTip() { MainWindow::getInstance()->toggleStatusToolTip(ui.checkBoxDisableSysTrayToolTip->isChecked()); }
void AppearancePage::updateCmboToolButtonStyle() void AppearancePage::updateCmboToolButtonStyle()
@ -149,6 +159,7 @@ void AppearancePage::updateCmboToolButtonStyle()
default: default:
Settings->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); Settings->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
} }
NotifyQt::getInstance()->notifySettingsChanged();
} }
void AppearancePage::updateCmboToolButtonSize() void AppearancePage::updateCmboToolButtonSize()
@ -174,6 +185,7 @@ void AppearancePage::updateCmboToolButtonSize()
case 5: case 5:
Settings->setToolButtonSize(128); Settings->setToolButtonSize(128);
} }
NotifyQt::getInstance()->notifySettingsChanged();
} }
void AppearancePage::updateCmboListItemSize() void AppearancePage::updateCmboListItemSize()
{ {
@ -198,6 +210,7 @@ void AppearancePage::updateCmboListItemSize()
case 5: case 5:
Settings->setListItemIconSize(128); Settings->setListItemIconSize(128);
} }
NotifyQt::getInstance()->notifySettingsChanged();
} }
void AppearancePage::updateStyle() { Rshare::setStyle(ui.cmboStyle->currentText()); } void AppearancePage::updateStyle() { Rshare::setStyle(ui.cmboStyle->currentText()); }
@ -218,10 +231,9 @@ void AppearancePage::load()
} }
ui.cmboStyleSheet->setCurrentIndex(index); ui.cmboStyleSheet->setCurrentIndex(index);
ui.rbtPageOnToolBar->setChecked(Settings->getPageButtonLoc()); ui.mainPageButtonType_CB->setCurrentIndex(!Settings->getPageButtonLoc());
ui.rbtPageOnListItem->setChecked(!Settings->getPageButtonLoc()); ui.menuItemsButtonType_CB->setCurrentIndex(!Settings->getActionButtonLoc());
ui.rbtActionOnToolBar->setChecked(Settings->getActionButtonLoc());
ui.rbtActionOnListItem->setChecked(!Settings->getActionButtonLoc());
switch (Settings->getToolButtonStyle()) switch (Settings->getToolButtonStyle())
{ {
case Qt::ToolButtonIconOnly: case Qt::ToolButtonIconOnly:

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1160</width> <width>1160</width>
<height>608</height> <height>897</height>
</rect> </rect>
</property> </property>
<property name="contextMenuPolicy"> <property name="contextMenuPolicy">
@ -44,13 +44,6 @@
<string>Language</string> <string>Language</string>
</property> </property>
<layout class="QGridLayout" name="grpLanguageGLayout"> <layout class="QGridLayout" name="grpLanguageGLayout">
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="labelLanguage">
<property name="text">
<string>Changes to language will only take effect after restarting RetroShare!</string>
</property>
</widget>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QComboBox" name="cmboLanguage"> <widget class="QComboBox" name="cmboLanguage">
<property name="minimumSize"> <property name="minimumSize">
@ -70,7 +63,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="2">
<spacer name="grpLanguageHSpacer"> <spacer name="grpLanguageHSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
@ -83,6 +76,13 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="1" column="1">
<widget class="QLabel" name="labelLanguage">
<property name="text">
<string>(Needs restart)</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@ -198,124 +198,84 @@
<property name="title"> <property name="title">
<string>Tool Bar</string> <string>Tool Bar</string>
</property> </property>
<layout class="QGridLayout" name="grpToolBarGLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item row="4" column="0"> <item>
<widget class="QFrame" name="frameAction"> <layout class="QHBoxLayout" name="horizontalLayout">
<property name="frameShape"> <item>
<enum>QFrame::StyledPanel</enum> <widget class="QLabel" name="labelPageToolBar">
</property> <property name="text">
<property name="frameShadow"> <string>Main page items:</string>
<enum>QFrame::Plain</enum> </property>
</property> </widget>
<layout class="QHBoxLayout" name="frameActionHLayout"> </item>
<property name="leftMargin"> <item>
<number>2</number> <widget class="QComboBox" name="mainPageButtonType_CB">
</property> <item>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<widget class="QRadioButton" name="rbtActionOnToolBar">
<property name="text"> <property name="text">
<string>On Tool Bar</string> <string>Buttons</string>
</property> </property>
</widget> </item>
</item> <item>
<item>
<widget class="QRadioButton" name="rbtActionOnListItem">
<property name="text"> <property name="text">
<string>On List Ite&amp;m</string> <string>Item list</string>
</property> </property>
</widget> </item>
</item> </widget>
<item> </item>
<spacer name="frameActionHSpacer"> <item>
<property name="orientation"> <spacer name="framePageHSpacer">
<enum>Qt::Horizontal</enum> <property name="orientation">
</property> <enum>Qt::Horizontal</enum>
<property name="sizeHint" stdset="0"> </property>
<size> <property name="sizeHint" stdset="0">
<width>300</width> <size>
<height>16</height> <width>300</width>
</size> <height>16</height>
</property> </size>
</spacer> </property>
</item> </spacer>
</layout> </item>
</widget> </layout>
</item> </item>
<item row="3" column="0"> <item>
<widget class="QLabel" name="labelActionToolBar"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="text"> <item>
<string>Where do you want to have the buttons for menu?</string> <widget class="QLabel" name="labelActionToolBar">
</property> <property name="text">
</widget> <string>Menu items:</string>
</item> </property>
<item row="2" column="0"> </widget>
<widget class="QFrame" name="framePage"> </item>
<property name="frameShape"> <item>
<enum>QFrame::StyledPanel</enum> <widget class="QComboBox" name="menuItemsButtonType_CB">
</property> <item>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<layout class="QHBoxLayout" name="framePageHLayout">
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<widget class="QRadioButton" name="rbtPageOnToolBar">
<property name="text"> <property name="text">
<string>On Tool Bar</string> <string>Buttons</string>
</property> </property>
</widget> </item>
</item> <item>
<item>
<widget class="QRadioButton" name="rbtPageOnListItem">
<property name="text"> <property name="text">
<string>On List Item</string> <string>Item list</string>
</property> </property>
</widget> </item>
</item> </widget>
<item> </item>
<spacer name="framePageHSpacer"> <item>
<property name="orientation"> <spacer name="frameActionHSpacer">
<enum>Qt::Horizontal</enum> <property name="orientation">
</property> <enum>Qt::Horizontal</enum>
<property name="sizeHint" stdset="0"> </property>
<size> <property name="sizeHint" stdset="0">
<width>300</width> <size>
<height>16</height> <width>300</width>
</size> <height>16</height>
</property> </size>
</spacer> </property>
</item> </spacer>
</layout> </item>
</widget> </layout>
</item> </item>
<item row="1" column="0"> <item>
<widget class="QLabel" name="labelPageToolBar">
<property name="text">
<string>Where do you want to have the buttons for the page?</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QFrame" name="frameToolListStyle"> <widget class="QFrame" name="frameToolListStyle">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">

View File

@ -30,10 +30,9 @@ ChannelPage::ChannelPage(QWidget * parent, Qt::WindowFlags flags)
/* Initialize GroupFrameSettingsWidget */ /* Initialize GroupFrameSettingsWidget */
ui.groupFrameSettingsWidget->setOpenAllInNewTabText(tr("Open each channel in a new tab")); ui.groupFrameSettingsWidget->setOpenAllInNewTabText(tr("Open each channel in a new tab"));
ui.groupFrameSettingsWidget->setType(GroupFrameSettings::Channel) ;
connect(ui.loadThreadCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateLoadThread)) ; connect(ui.loadThreadCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateLoadThread)) ;
ui.groupFrameSettingsWidget->setType(GroupFrameSettings::Channel) ;
} }
void ChannelPage::updateLoadThread() { Settings->setChannelLoadThread(ui.loadThreadCheckBox->isChecked()); } void ChannelPage::updateLoadThread() { Settings->setChannelLoadThread(ui.loadThreadCheckBox->isChecked()); }

View File

@ -53,10 +53,7 @@ MessagePage::MessagePage(QWidget * parent, Qt::WindowFlags flags)
connect(ui.setMsgToReadOnActivate,SIGNAL(toggled(bool)), this,SLOT(updateMsgToReadOnActivate())); connect(ui.setMsgToReadOnActivate,SIGNAL(toggled(bool)), this,SLOT(updateMsgToReadOnActivate()));
connect(ui.loadEmbeddedImages, SIGNAL(toggled(bool)), this,SLOT(updateLoadEmbededImages() )); connect(ui.loadEmbeddedImages, SIGNAL(toggled(bool)), this,SLOT(updateLoadEmbededImages() ));
connect(ui.openComboBox, SIGNAL(currentItemChanged(int)),this,SLOT(updateMsgOpen() )); connect(ui.openComboBox, SIGNAL(currentIndexChanged(int)),this,SLOT(updateMsgOpen() ));
connect(ui.comboBox, SIGNAL(currebtItemChanged(int)),this,SLOT(updateDistantMsgs() ));
connect(ui.comboBox, SIGNAL(currebtItemChanged(int)),this,SLOT(updateMsgTags() ));
} }
MessagePage::~MessagePage() MessagePage::~MessagePage()

View File

@ -31,16 +31,18 @@
ServicePermissionsPage::ServicePermissionsPage(QWidget * parent, Qt::WindowFlags flags) : ServicePermissionsPage::ServicePermissionsPage(QWidget * parent, Qt::WindowFlags flags) :
ConfigPage(parent, flags) ConfigPage(parent, flags)
{ {
/* Invoke the Qt Designer generated object setup routine */ /* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this); ui.setupUi(this);
connect(ui.cb_hideOffline, SIGNAL(toggled(bool)), ui.frame, SLOT(setHideOffline(bool))); ui.cb_hideOffline->setChecked(true);
//QObject::connect(ui.tableWidget,SIGNAL(itemChanged(QTableWidgetItem *)), this, SLOT(tableItemChanged(QTableWidgetItem *)));
ui.frame->setHideOffline(ui.cb_hideOffline->isChecked()); connect(ui.cb_hideOffline, SIGNAL(toggled(bool)), ui.frame, SLOT(setHideOffline(bool)));
//QObject::connect(ui.tableWidget,SIGNAL(itemChanged(QTableWidgetItem *)), this, SLOT(tableItemChanged(QTableWidgetItem *)));
// Not implemented? ui.frame->setHideOffline(ui.cb_hideOffline->isChecked());
ui.pushButton->hide();
// Not implemented?
ui.pushButton->hide();
} }
QString ServicePermissionsPage::helpText() const QString ServicePermissionsPage::helpText() const

View File

@ -148,6 +148,9 @@ void WebuiPage::onEnableCBClicked(bool checked)
ui.params_GB->setEnabled(false); ui.params_GB->setEnabled(false);
ui.applyStartBrowser_PB->setEnabled(false); ui.applyStartBrowser_PB->setEnabled(false);
} }
QString S;
updateParams(S);
} }
void WebuiPage::onApplyClicked() void WebuiPage::onApplyClicked()