mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-21 07:19:54 -05:00
added changes from GeneralDialog to GeneralPage
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1546 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
13d099702c
commit
b91d9ab4b8
@ -509,7 +509,14 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTextEdit" name="certtextEdit"/>
|
||||
<widget class="QTextEdit" name="certtextEdit">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>7</pointsize>
|
||||
<kerning>false</kerning>
|
||||
</font>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
@ -1,8 +1,7 @@
|
||||
/****************************************************************
|
||||
* This file is distributed under the following license:
|
||||
*
|
||||
* Copyright (c) 2006-2007, crypton
|
||||
* Copyright (c) 2006, Matt Edman, Justin Hipple
|
||||
* Copyright (c) 2009 RetroShare Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -20,43 +19,44 @@
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
#include "GeneralPage.h"
|
||||
#include "rshare.h"
|
||||
#include "GeneralPage.h"
|
||||
#include <util/stringutil.h>
|
||||
|
||||
#include <QSystemTrayIcon>
|
||||
|
||||
/** Constructor */
|
||||
GeneralPage::GeneralPage(QWidget * parent, Qt::WFlags flags)
|
||||
: QWidget(parent, flags)
|
||||
: QWidget(parent, flags)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
setAttribute(Qt::WA_QuitOnClose, false);
|
||||
setWindowTitle(windowTitle() + QLatin1String(" - General"));
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
ui.setupUi(this);
|
||||
|
||||
|
||||
/* Create RshareSettings object */
|
||||
_settings = new RshareSettings();
|
||||
/* Create RshareSettings object */
|
||||
_settings = new RshareSettings();
|
||||
|
||||
load();
|
||||
|
||||
/* Hide platform specific features */
|
||||
/* Hide platform specific features */
|
||||
#ifndef Q_WS_WIN
|
||||
ui.chkRunRetroshareAtSystemStartup->setVisible(false);
|
||||
#endif ´
|
||||
//ui.autologincheckBox->setEnabled(false) ;
|
||||
//ui.autologincheckBox->setChecked(false) ;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
GeneralPage::closeEvent (QCloseEvent * event)
|
||||
/** Destructor */
|
||||
/*GeneralPage::~GeneralPage()
|
||||
{
|
||||
|
||||
QWidget::closeEvent(event);
|
||||
}
|
||||
|
||||
delete _settings;
|
||||
}*/
|
||||
|
||||
/** Saves the changes on this page */
|
||||
bool
|
||||
GeneralPage::save(QString &errmsg)
|
||||
{
|
||||
{
|
||||
_settings->setValue(QString::fromUtf8("StartMinimized"), startMinimized());
|
||||
|
||||
_settings->setValue(QString::fromUtf8("doQuit"), quit());
|
||||
|
||||
_settings->setRunRetroshareOnBoot(
|
||||
ui.chkRunRetroshareAtSystemStartup->isChecked());
|
||||
@ -67,11 +67,19 @@ GeneralPage::save(QString &errmsg)
|
||||
/** Loads the settings for this page */
|
||||
void
|
||||
GeneralPage::load()
|
||||
{
|
||||
{
|
||||
ui.chkRunRetroshareAtSystemStartup->setChecked(
|
||||
_settings->runRetroshareOnBoot());
|
||||
|
||||
ui.checkStartMinimized->setChecked(_settings->value(QString::fromUtf8("StartMinimized"), false).toBool());
|
||||
|
||||
ui.checkQuit->setChecked(_settings->value(QString::fromUtf8("doQuit"), false).toBool());
|
||||
|
||||
}
|
||||
|
||||
bool GeneralPage::quit() const {
|
||||
if(ui.checkQuit->isChecked()) return true;
|
||||
return ui.checkQuit->isChecked();
|
||||
}
|
||||
|
||||
bool GeneralPage::startMinimized() const {
|
||||
@ -86,5 +94,3 @@ GeneralPage::toggleShowOnStartup(bool checked)
|
||||
//RshareSettings _settings;
|
||||
_settings->setShowMainWindowAtStart(checked);
|
||||
}
|
||||
|
||||
|
||||
|
@ -20,47 +20,50 @@
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
#ifndef GENERALPAGE_H
|
||||
# define GENERALPAGE_H
|
||||
#ifndef _GENERALPAGE_H
|
||||
#define _GENERALPAGE_H
|
||||
|
||||
#include <QStyleFactory>
|
||||
#include <QtGui>
|
||||
#include <QFileDialog>
|
||||
#include <QLineEdit>
|
||||
|
||||
#include "gui/Preferences/rsharesettings.h"
|
||||
#include "lang/languagesupport.h"
|
||||
|
||||
# include <QtGui/QWidget>
|
||||
# include "ui_GeneralPage.h"
|
||||
#include "ui_GeneralPage.h"
|
||||
|
||||
class GeneralPage: public QWidget
|
||||
|
||||
class GeneralPage : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GeneralPage(QWidget * parent = 0, Qt::WFlags flags = 0);
|
||||
~GeneralPage() {}
|
||||
|
||||
/** Saves the changes on this page */
|
||||
bool save(QString &errmsg);
|
||||
/** Loads the settings for this page */
|
||||
void load();
|
||||
|
||||
bool startMinimized() const;
|
||||
public:
|
||||
/** Default Constructor */
|
||||
GeneralPage(QWidget * parent = 0, Qt::WFlags flags = 0);
|
||||
/** Default Destructor */
|
||||
~GeneralPage() {}
|
||||
|
||||
private slots:
|
||||
/** Saves the changes on this page */
|
||||
bool save(QString &errmsg);
|
||||
/** Loads the settings for this page */
|
||||
void load();
|
||||
bool startMinimized() const;
|
||||
bool quit() const;
|
||||
|
||||
/** Called when the "show on startup" checkbox is toggled. */
|
||||
void toggleShowOnStartup(bool checked);
|
||||
|
||||
private:
|
||||
/** A VidaliaSettings object used for saving/loading settings */
|
||||
RshareSettings* _settings;
|
||||
|
||||
|
||||
void closeEvent (QCloseEvent * event);
|
||||
|
||||
Ui::GeneralPage ui;
|
||||
private slots:
|
||||
|
||||
/** Called when the "show on startup" checkbox is toggled. */
|
||||
void toggleShowOnStartup(bool checked);
|
||||
|
||||
private:
|
||||
/** A RetroShare Settings object used for saving/loading settings */
|
||||
RshareSettings *_settings;
|
||||
|
||||
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::GeneralPage ui;
|
||||
};
|
||||
|
||||
#endif // !GENERALPAGE_H
|
||||
#endif
|
||||
|
||||
|
@ -499,13 +499,7 @@
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::NoContextMenu</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout">
|
||||
<property name="margin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="minimumSize">
|
||||
@ -539,14 +533,30 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Misc</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="checkQuit">
|
||||
<property name="text">
|
||||
<string>Do not show the Quit RetroShare MessageBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>401</width>
|
||||
<height>91</height>
|
||||
<width>178</width>
|
||||
<height>95</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
|
Loading…
x
Reference in New Issue
Block a user