Removed own settings for news feed.

Added parameter to RSettingsWin::showYourself to show the options with a specific page.
Fixed german language.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4104 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2011-03-26 22:17:15 +00:00
parent c820826260
commit 5250c27fed
10 changed files with 20 additions and 353 deletions

View file

@ -1,124 +0,0 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2011 RetroShare Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
#include "FeedSettings.h"
#include <rshare.h>
#include <retroshare/rsnotify.h>
#include "gui/settings/rsharesettings.h"
/** Default constructor */
FeedSettings::FeedSettings(QWidget *parent, Qt::WFlags flags)
: QDialog(parent, flags)
{
/* Invoke Qt Designer generated QObject setup routine */
ui.setupUi(this);
connect(ui.applyButton, SIGNAL(clicked()), this, SLOT(applyDialog()));
connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(closeinfodlg()));
ui.applyButton->setToolTip(tr("Apply and Close"));
load();
/* Hide platform specific features */
#ifdef Q_WS_WIN
#endif
}
void FeedSettings::show()
{
if(!this->isVisible()) {
QDialog::show();
}
}
void FeedSettings::closeEvent (QCloseEvent * event)
{
QWidget::closeEvent(event);
}
/** Saves the changes on this page */
bool FeedSettings::save()
{
/* extract from rsNotify the flags */
uint newsflags = 0;
if (ui.notify_Peers->isChecked())
newsflags |= RS_FEED_TYPE_PEER;
if (ui.notify_Channels->isChecked())
newsflags |= RS_FEED_TYPE_CHAN;
if (ui.notify_Forums->isChecked())
newsflags |= RS_FEED_TYPE_FORUM;
if (ui.notify_Blogs->isChecked())
newsflags |= RS_FEED_TYPE_BLOG;
if (ui.notify_Chat->isChecked())
newsflags |= RS_FEED_TYPE_CHAT;
if (ui.notify_Messages->isChecked())
newsflags |= RS_FEED_TYPE_MSG;
if (ui.notify_Chat->isChecked())
newsflags |= RS_FEED_TYPE_CHAT;
Settings->setNewsFeedFlags(newsflags);
Settings->setAddFeedsAtEnd(ui.addFeedsAtEnd->isChecked());
load();
return true;
}
/** Loads the news feed settings */
void FeedSettings::load()
{
/* extract from rsNotify the flags */
uint newsflags = Settings->getNewsFeedFlags();
ui.notify_Peers->setChecked(newsflags & RS_FEED_TYPE_PEER);
ui.notify_Channels->setChecked(newsflags & RS_FEED_TYPE_CHAN);
ui.notify_Forums->setChecked(newsflags & RS_FEED_TYPE_FORUM);
ui.notify_Blogs->setChecked(newsflags & RS_FEED_TYPE_BLOG);
ui.notify_Chat->setChecked(newsflags & RS_FEED_TYPE_CHAT);
ui.notify_Messages->setChecked(newsflags & RS_FEED_TYPE_MSG);
ui.notify_Chat->setChecked(newsflags & RS_FEED_TYPE_CHAT);
ui.addFeedsAtEnd->setChecked(Settings->getAddFeedsAtEnd());
}
void FeedSettings::closeinfodlg()
{
close();
}
void FeedSettings::applyDialog()
{
/* reload now */
save();
/* close the Dialog after the Changes applied */
closeinfodlg();
}

View file

@ -1,68 +0,0 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2011 RetroShare Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
#ifndef _FEEDSETTINGS_H
#define _FEEDSETTINGS_H
#include <QDialog>
#include "ui_FeedSettings.h"
class FeedSettings : public QDialog
{
Q_OBJECT
public:
/** Default constructor */
FeedSettings(QWidget *parent = 0, Qt::WFlags flags = 0);
/** Default destructor */
/** Saves the changes */
bool save();
/** Loads the news feed settings */
void load();
signals:
void configChanged() ;
public slots:
/** Overloaded QWidget.show */
void show();
protected:
void closeEvent (QCloseEvent * event);
private slots:
void closeinfodlg();
void applyDialog();
private:
/** Qt Designer generated object */
Ui::FeedSettings ui;
};
#endif

View file

@ -1,148 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>FeedSettings</class>
<widget class="QDialog" name="FeedSettings">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>409</width>
<height>329</height>
</rect>
</property>
<property name="windowTitle">
<string>Edit your News Feed Settings</string>
</property>
<property name="windowIcon">
<iconset resource="../images.qrc">
<normaloff>:/images/rstray3.png</normaloff>:/images/rstray3.png</iconset>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QGroupBox" name="notify_ForumNewMsg">
<property name="title">
<string>News Feed</string>
</property>
<layout class="QVBoxLayout" name="_3">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>6</number>
</property>
<item>
<widget class="QCheckBox" name="notify_Peers">
<property name="text">
<string>Peers</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="notify_Channels">
<property name="text">
<string>Channels</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="notify_Forums">
<property name="text">
<string>Forums</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="notify_Blogs">
<property name="text">
<string>Blogs</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="notify_Messages">
<property name="text">
<string>Messages</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="notify_Chat">
<property name="text">
<string>Chat</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="addFeedsAtEnd">
<property name="text">
<string>Add feeds at end</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<layout class="QGridLayout" name="_2">
<item row="0" column="0">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>311</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="cancelButton">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="applyButton">
<property name="text">
<string>OK</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources>
<include location="../images.qrc"/>
</resources>
<connections/>
</ui>