mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-11 02:25:34 -04:00
reworked settings
now there is only one global object for loading and saving settings RshareSettings *Settings; the class RSettings can be used too, but it is not prefered, because the default settings has no affect git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2964 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e68e6b54ef
commit
6baf56285b
39 changed files with 336 additions and 390 deletions
|
@ -61,8 +61,7 @@ ApplicationWindow::ApplicationWindow(QWidget* parent, Qt::WFlags flags)
|
|||
|
||||
setWindowTitle(tr("RetroShare"));
|
||||
|
||||
RshareSettings config;
|
||||
config.loadWidgetInformation(this);
|
||||
Settings->loadWidgetInformation(this);
|
||||
|
||||
// Setting icons
|
||||
this->setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
||||
|
@ -155,8 +154,7 @@ void ApplicationWindow::createActions()
|
|||
|
||||
void ApplicationWindow::closeEvent(QCloseEvent *e)
|
||||
{
|
||||
RshareSettings config;
|
||||
config.saveWidgetInformation(this);
|
||||
Settings->saveWidgetInformation(this);
|
||||
|
||||
hide();
|
||||
e->ignore();
|
||||
|
|
|
@ -43,9 +43,6 @@ StatisticDialog::StatisticDialog(QWidget *parent)
|
|||
/* Invoke the Qt Designer generated object setup routine */
|
||||
ui.setupUi(this);
|
||||
|
||||
/* Create Bandwidth Graph related QObjects */
|
||||
_settings = new RshareSettings();
|
||||
|
||||
/* Bind events to actions */
|
||||
createActions();
|
||||
|
||||
|
@ -85,12 +82,6 @@ StatisticDialog::StatisticDialog(QWidget *parent)
|
|||
|
||||
}
|
||||
|
||||
/** Default destructor */
|
||||
StatisticDialog::~StatisticDialog()
|
||||
{
|
||||
delete _settings;
|
||||
}
|
||||
|
||||
/**
|
||||
Custom event handler. Checks if the event is a bandwidth update event. If it
|
||||
is, it will add the data point to the history and updates the graph.*/
|
||||
|
@ -182,7 +173,7 @@ StatisticDialog::loadSettings()
|
|||
|
||||
|
||||
/* Set the line filter checkboxes accordingly */
|
||||
uint filter = _settings->getBWGraphFilter();
|
||||
uint filter = Settings->getBWGraphFilter();
|
||||
ui.chkReceiveRate->setChecked(filter & BWGRAPH_REC);
|
||||
ui.chkSendRate->setChecked(filter & BWGRAPH_SEND);
|
||||
|
||||
|
@ -215,13 +206,13 @@ StatisticDialog::saveChanges()
|
|||
showSettingsFrame(false);
|
||||
|
||||
/* Save the opacity */
|
||||
_settings->setBWGraphOpacity(ui.sldrOpacity->value());
|
||||
Settings->setBWGraphOpacity(ui.sldrOpacity->value());
|
||||
|
||||
|
||||
|
||||
/* Save the line filter values */
|
||||
_settings->setBWGraphFilter(BWGRAPH_REC, ui.chkReceiveRate->isChecked());
|
||||
_settings->setBWGraphFilter(BWGRAPH_SEND, ui.chkSendRate->isChecked());
|
||||
Settings->setBWGraphFilter(BWGRAPH_REC, ui.chkReceiveRate->isChecked());
|
||||
Settings->setBWGraphFilter(BWGRAPH_SEND, ui.chkSendRate->isChecked());
|
||||
|
||||
/* Update the graph frame settings */
|
||||
ui.frmGraph->setShowCounters(ui.chkReceiveRate->isChecked(),
|
||||
|
|
|
@ -42,8 +42,7 @@ class StatisticDialog : public MainPage
|
|||
public:
|
||||
/** Default Constructor */
|
||||
StatisticDialog(QWidget *parent = 0);
|
||||
/** Default Destructor */
|
||||
~StatisticDialog();
|
||||
|
||||
protected:
|
||||
/** Called to deliver a bandwidth update event from RetroShare. */
|
||||
void customEvent(QEvent *event);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue