mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-03-29 01:58:16 -04:00
add new settings
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1559 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
19920e95bc
commit
1c93c63ba4
@ -1,4 +1,4 @@
|
||||
CONFIG += qt gui uic qrc resources uitools debug pluginmgr #release newsettings
|
||||
CONFIG += qt gui uic qrc resources uitools debug pluginmgr newsettings #release
|
||||
QT += network xml script
|
||||
TEMPLATE = app
|
||||
TARGET = RetroShare
|
||||
|
@ -15,7 +15,7 @@
|
||||
*
|
||||
* 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,
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
@ -30,8 +30,6 @@
|
||||
#include <rshare.h>
|
||||
#include "ApplicationWindow.h"
|
||||
|
||||
|
||||
#include "Preferences/PreferencesWindow.h"
|
||||
//#include "Settings/gsettingswin.h"
|
||||
|
||||
#include "rsiface/rsiface.h"
|
||||
@ -101,12 +99,12 @@ ApplicationWindow::ApplicationWindow(QWidget* parent, Qt::WFlags flags)
|
||||
{
|
||||
/* Invoke the Qt Designer generated QObject setup routine */
|
||||
ui.setupUi(this);
|
||||
|
||||
|
||||
setWindowTitle(tr("RetroShare"));
|
||||
|
||||
RshareSettings config;
|
||||
config.loadWidgetInformation(this);
|
||||
|
||||
|
||||
// Setting icons
|
||||
this->setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
||||
loadStyleSheet("Default");
|
||||
@ -121,27 +119,27 @@ ApplicationWindow::ApplicationWindow(QWidget* parent, Qt::WFlags flags)
|
||||
// ChannelsDialog *channelsDialog = NULL;
|
||||
// ui.stackPages->add(channelsDialog = new ChannelsDialog(ui.stackPages),
|
||||
// createPageAction(QIcon(IMAGE_CHANNELS), tr("Channels"), grp));
|
||||
|
||||
|
||||
//NewsFeed *newsFeed = NULL;
|
||||
//ui.stackPages->add(newsFeed = new NewsFeed(ui.stackPages),
|
||||
// createPageAction(QIcon(IMAGE_NEWSFEED), tr("News Feed"), grp));
|
||||
|
||||
|
||||
StatisticDialog *statisticDialog = NULL;
|
||||
ui.stackPages->add(statisticDialog = new StatisticDialog(ui.stackPages),
|
||||
createPageAction(QIcon(IMAGE_STATISTIC), tr("Statistics"), grp));
|
||||
|
||||
|
||||
PeersFeed *peersFeed = NULL;
|
||||
ui.stackPages->add(peersFeed = new PeersFeed(ui.stackPages),
|
||||
createPageAction(QIcon(IMAGE_PEERS), tr("Peers"), grp));
|
||||
|
||||
|
||||
TransferFeed *transferFeed = NULL;
|
||||
ui.stackPages->add(transferFeed = new TransferFeed(ui.stackPages),
|
||||
createPageAction(QIcon(IMAGE_LINKS), tr("Transfers"), grp));
|
||||
|
||||
|
||||
MsgFeed *msgFeed = NULL;
|
||||
ui.stackPages->add(msgFeed = new MsgFeed(ui.stackPages),
|
||||
createPageAction(QIcon(IMAGE_MESSAGES), tr("Messages"), grp));
|
||||
|
||||
|
||||
BlogDialog *blogDialog = NULL;
|
||||
ui.stackPages->add(blogDialog = new BlogDialog(ui.stackPages),
|
||||
createPageAction(QIcon(IMAGE_BLOGS), tr("Blog Feed"), grp));
|
||||
@ -153,7 +151,7 @@ ApplicationWindow::ApplicationWindow(QWidget* parent, Qt::WFlags flags)
|
||||
// ForumsDialog *forumsDialog = NULL;
|
||||
// ui.stackPages->add(forumsDialog = new ForumsDialog(ui.stackPages),
|
||||
// createPageAction(QIcon(IMAGE_FORUMS), tr("Forums"), grp));
|
||||
|
||||
|
||||
GamesDialog *gamesDialog = NULL;
|
||||
ui.stackPages->add(gamesDialog = new GamesDialog(ui.stackPages),
|
||||
createPageAction(QIcon(IMAGE_GAMES), tr("Games Launcher"), grp));
|
||||
@ -161,21 +159,21 @@ ApplicationWindow::ApplicationWindow(QWidget* parent, Qt::WFlags flags)
|
||||
PhotoDialog *photoDialog = NULL;
|
||||
ui.stackPages->add(photoDialog = new PhotoDialog(ui.stackPages),
|
||||
createPageAction(QIcon(IMAGE_PHOTO), tr("Photo View"), grp));
|
||||
|
||||
|
||||
LibraryDialog *libraryDialog = NULL;
|
||||
ui.stackPages->add(libraryDialog = new LibraryDialog(ui.stackPages),
|
||||
createPageAction(QIcon(IMAGE_LIBRARY), tr("Library"), grp));
|
||||
|
||||
|
||||
CalDialog *calDialog = NULL;
|
||||
ui.stackPages->add(calDialog = new CalDialog(ui.stackPages),
|
||||
createPageAction(QIcon(IMAGE_CALENDAR), tr("Shared Calendars"), grp));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//ui.stackPages->add(groupsDialog = new GroupsDialog(ui.stackPages),
|
||||
// createPageAction(QIcon(), tr("Groups"), grp));
|
||||
|
||||
|
||||
//ui.stackPages->add(new StatisticDialog(ui.stackPages),
|
||||
// createPageAction(QIcon(IMAGE_STATISTIC), tr("Statistics"), grp));
|
||||
|
||||
@ -210,7 +208,7 @@ void ApplicationWindow::addAction(QAction *action, const char *slot)
|
||||
/** Overloads the default show so we can load settings */
|
||||
void ApplicationWindow::show()
|
||||
{
|
||||
|
||||
|
||||
if (!this->isVisible()) {
|
||||
QMainWindow::show();
|
||||
} else {
|
||||
@ -295,9 +293,9 @@ void ApplicationWindow::loadStyleSheet(const QString &sheetName)
|
||||
file.open(QFile::ReadOnly);
|
||||
QString styleSheet = QLatin1String(file.readAll());
|
||||
|
||||
|
||||
|
||||
qApp->setStyleSheet(styleSheet);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/** Shows smplayer */
|
||||
@ -305,11 +303,11 @@ void ApplicationWindow::showsmplayer()
|
||||
{
|
||||
#if 0
|
||||
static SMPlayer * smplayer = 0;
|
||||
|
||||
|
||||
if (smplayer == 0) {
|
||||
smplayer = new SMPlayer(QString::null, this);
|
||||
}
|
||||
|
||||
|
||||
smplayer->gui()->show();
|
||||
#endif
|
||||
}
|
||||
|
@ -50,12 +50,6 @@
|
||||
#include "statusbar/natstatus.h"
|
||||
#include "statusbar/ratesstatus.h"
|
||||
|
||||
#include "Preferences/PreferencesWindow.h"
|
||||
|
||||
#ifdef NEWSETTINGS
|
||||
#include "settings/rsettingswin.h"
|
||||
#endif
|
||||
|
||||
#include "rsiface/rsiface.h"
|
||||
#include "rsiface/rspeers.h"
|
||||
#include "rsiface/rsfiles.h"
|
||||
@ -129,7 +123,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
/* Create all the dialogs of which we only want one instance */
|
||||
_bandwidthGraph = new BandwidthGraph();
|
||||
messengerWindow = new MessengerWindow();
|
||||
_preferencesWindow = new PreferencesWindow();
|
||||
_settingsWindow = new RSettingsWin();
|
||||
applicationWindow = new ApplicationWindow();
|
||||
applicationWindow->hide();
|
||||
|
||||
@ -433,9 +427,9 @@ void MainWindow::openShareManager()
|
||||
/** Creates and displays the Configuration dialog with the current page set to
|
||||
* <b>page</b>. */
|
||||
void
|
||||
MainWindow::showPreferencesWindow(PreferencesWindow::Page page)
|
||||
MainWindow::showPreferencesWindow(RSettingsWin::PageType page)
|
||||
{
|
||||
_preferencesWindow->showWindow(page);
|
||||
_settingsWindow->showWindow(page);
|
||||
}
|
||||
|
||||
/** Shows Messages Dialog */
|
||||
@ -476,7 +470,7 @@ MainWindow::~MainWindow()
|
||||
{
|
||||
delete _bandwidthGraph;
|
||||
delete _messengerwindowAct;
|
||||
delete _preferencesWindow;
|
||||
delete _settingsWindow;
|
||||
}
|
||||
|
||||
/** Create and bind actions to events. Setup for initial
|
||||
@ -511,8 +505,8 @@ void MainWindow::createActions()
|
||||
*/
|
||||
void MainWindow::doQuit()
|
||||
{
|
||||
|
||||
if(!_settings->value(QString::fromUtf8("doQuit"), false).toBool())
|
||||
|
||||
if(!_settings->value(QString::fromUtf8("doQuit"), false).toBool())
|
||||
{
|
||||
QString queryWrn;
|
||||
queryWrn.clear();
|
||||
|
@ -15,7 +15,7 @@
|
||||
*
|
||||
* 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,
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
@ -38,8 +38,7 @@
|
||||
#include "ApplicationWindow.h"
|
||||
#include "PluginsPage.h"
|
||||
|
||||
#include "Preferences/PreferencesWindow.h"
|
||||
#include "Preferences/rsharesettings.h"
|
||||
#include "settings/rsettingswin.h"
|
||||
|
||||
#include "bwgraph/bwgraph.h"
|
||||
#include "help/browser/helpbrowser.h"
|
||||
@ -47,7 +46,6 @@
|
||||
|
||||
#include "ui_MainWindow.h"
|
||||
|
||||
|
||||
class PeerStatus;
|
||||
class DHTStatus;
|
||||
class NATStatus;
|
||||
@ -72,20 +70,20 @@ public:
|
||||
Channels, /** Channels page. */
|
||||
Forums /** Forums page. */
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
/** Default Constructor */
|
||||
MainWindow(QWidget *parent = 0, Qt::WFlags flags = 0);
|
||||
|
||||
|
||||
/** Destructor. */
|
||||
~MainWindow();
|
||||
|
||||
/* A Bit of a Hack... but public variables for
|
||||
* the dialogs, so we can add them to the
|
||||
/* A Bit of a Hack... but public variables for
|
||||
* the dialogs, so we can add them to the
|
||||
* Notify Class...
|
||||
*/
|
||||
|
||||
|
||||
NetworkDialog *networkDialog;
|
||||
PeersDialog *peersDialog;
|
||||
SearchDialog *searchDialog;
|
||||
@ -104,7 +102,7 @@ public slots:
|
||||
//void show();
|
||||
/** Shows the config dialog with focus set to the given page. */
|
||||
void showWindow(Page page);
|
||||
|
||||
|
||||
void playFiles(QStringList files);
|
||||
void updateHashingInfo(const QString&) ;
|
||||
|
||||
@ -112,7 +110,7 @@ private slots:
|
||||
|
||||
void updateMenu();
|
||||
void updateStatus();
|
||||
|
||||
|
||||
void toggleVisibility(QSystemTrayIcon::ActivationReason e);
|
||||
void toggleVisibilitycontextmenu();
|
||||
|
||||
@ -124,7 +122,7 @@ private slots:
|
||||
void showabout();
|
||||
void openShareManager();
|
||||
void displaySystrayMsg(const QString&,const QString&) ;
|
||||
|
||||
|
||||
/** Displays the help browser and displays the most recently viewed help
|
||||
* topic. */
|
||||
void showHelpDialog();
|
||||
@ -133,16 +131,16 @@ private slots:
|
||||
|
||||
/** Creates and displays the Configuration dialog with the current page set
|
||||
* to <b>page</b>. */
|
||||
void showPreferencesWindow(PreferencesWindow::Page page = PreferencesWindow::General);
|
||||
void showPreferencesWindow(RSettingsWin::PageType page = RSettingsWin::General);
|
||||
void showMess(MainWindow::Page page = MainWindow::Messages);
|
||||
#ifdef NEWSETTINGS
|
||||
#ifdef NEWSETTINGS
|
||||
void showSettings();
|
||||
#endif
|
||||
void setStyle();
|
||||
|
||||
|
||||
/** Called when user attempts to quit via quit button*/
|
||||
void doQuit();
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
@ -151,14 +149,12 @@ protected:
|
||||
|
||||
private slots:
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
/** Create the actions on the tray menu or menubar */
|
||||
void createActions();
|
||||
|
||||
|
||||
|
||||
|
||||
/** Defines the actions for the tray menu */
|
||||
QAction* _prefsAct;
|
||||
QAction* _bandwidthAct;
|
||||
@ -167,23 +163,23 @@ private:
|
||||
QAction* _smplayerAct;
|
||||
QAction* _helpAct;
|
||||
QAction* _appAct;
|
||||
|
||||
|
||||
/** A BandwidthGraph object which handles monitoring RetroShare bandwidth usage */
|
||||
BandwidthGraph* _bandwidthGraph;
|
||||
|
||||
PreferencesWindow* _preferencesWindow;
|
||||
|
||||
|
||||
RSettingsWin *_settingsWindow;
|
||||
|
||||
/** A RetroShareSettings object used for saving/loading settings */
|
||||
RshareSettings* _settings;
|
||||
|
||||
|
||||
/** Creates a new action for a Main page. */
|
||||
QAction* createPageAction(QIcon img, QString text, QActionGroup *group);
|
||||
/** Adds a new action to the toolbar. */
|
||||
void addAction(QAction *action, const char *slot = 0);
|
||||
|
||||
|
||||
|
||||
|
||||
void loadStyleSheet(const QString &sheetName);
|
||||
|
||||
|
||||
QSystemTrayIcon *trayIcon;
|
||||
QAction *toggleVisibilityAction, *toolAct;
|
||||
QMenu *menu;
|
||||
@ -194,7 +190,7 @@ private:
|
||||
RatesStatus *ratesstatus;
|
||||
|
||||
QLabel *_hashing_info_label ;
|
||||
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::MainWindow ui;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user