mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-24 15:05:35 -04:00
added checkbox for Preferences to can disable the Quit MessageBox
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1508 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
792ddf1d25
commit
2380b0c793
4 changed files with 47 additions and 24 deletions
|
@ -323,7 +323,6 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||||
menu->addAction(_appAct);
|
menu->addAction(_appAct);
|
||||||
#endif
|
#endif
|
||||||
menu->addAction(_prefsAct);
|
menu->addAction(_prefsAct);
|
||||||
//menu->addAction(_smplayerAct);
|
|
||||||
menu->addAction(_helpAct);
|
menu->addAction(_helpAct);
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
menu->addAction(QIcon(IMAGE_MINIMIZE), tr("Minimize"), this, SLOT(showMinimized()));
|
menu->addAction(QIcon(IMAGE_MINIMIZE), tr("Minimize"), this, SLOT(showMinimized()));
|
||||||
|
@ -499,7 +498,6 @@ MainWindow::~MainWindow()
|
||||||
{
|
{
|
||||||
delete _bandwidthGraph;
|
delete _bandwidthGraph;
|
||||||
delete _messengerwindowAct;
|
delete _messengerwindowAct;
|
||||||
//delete _smplayerAct;
|
|
||||||
delete _preferencesWindow;
|
delete _preferencesWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -524,9 +522,6 @@ void MainWindow::createActions()
|
||||||
_appAct = new QAction(QIcon(IMAGE_UNFINISHED), tr("Applications"), this);
|
_appAct = new QAction(QIcon(IMAGE_UNFINISHED), tr("Applications"), this);
|
||||||
connect(_appAct, SIGNAL(triggered()),this, SLOT(showApplWindow()));
|
connect(_appAct, SIGNAL(triggered()),this, SLOT(showApplWindow()));
|
||||||
|
|
||||||
//_smplayerAct = new QAction(QIcon(IMAGE_SMPLAYER), tr("SMPlayer"), this);
|
|
||||||
//connect(_smplayerAct, SIGNAL(triggered()),this, SLOT(showsmplayer()));
|
|
||||||
|
|
||||||
_helpAct = new QAction(QIcon(IMG_HELP), tr("Help"), this);
|
_helpAct = new QAction(QIcon(IMG_HELP), tr("Help"), this);
|
||||||
connect(_helpAct, SIGNAL(triggered()), this, SLOT(showHelpDialog()));
|
connect(_helpAct, SIGNAL(triggered()), this, SLOT(showHelpDialog()));
|
||||||
|
|
||||||
|
@ -537,6 +532,9 @@ void MainWindow::createActions()
|
||||||
turned off for future quit events.
|
turned off for future quit events.
|
||||||
*/
|
*/
|
||||||
void MainWindow::doQuit()
|
void MainWindow::doQuit()
|
||||||
|
{
|
||||||
|
|
||||||
|
if(!_settings->value(QString::fromUtf8("doQuit"), false).toBool())
|
||||||
{
|
{
|
||||||
QString queryWrn;
|
QString queryWrn;
|
||||||
queryWrn.clear();
|
queryWrn.clear();
|
||||||
|
@ -550,6 +548,10 @@ void MainWindow::doQuit()
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
rsicontrol->rsGlobalShutDown();
|
||||||
|
qApp->quit();
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::closeEvent(QCloseEvent *e)
|
void MainWindow::closeEvent(QCloseEvent *e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -56,6 +56,8 @@ GeneralDialog::save(QString &errmsg)
|
||||||
{
|
{
|
||||||
_settings->setValue(QString::fromUtf8("StartMinimized"), startMinimized());
|
_settings->setValue(QString::fromUtf8("StartMinimized"), startMinimized());
|
||||||
|
|
||||||
|
_settings->setValue(QString::fromUtf8("doQuit"), quit());
|
||||||
|
|
||||||
_settings->setRunRetroshareOnBoot(
|
_settings->setRunRetroshareOnBoot(
|
||||||
ui.chkRunRetroshareAtSystemStartup->isChecked());
|
ui.chkRunRetroshareAtSystemStartup->isChecked());
|
||||||
|
|
||||||
|
@ -71,6 +73,13 @@ GeneralDialog::load()
|
||||||
|
|
||||||
ui.checkStartMinimized->setChecked(_settings->value(QString::fromUtf8("StartMinimized"), false).toBool());
|
ui.checkStartMinimized->setChecked(_settings->value(QString::fromUtf8("StartMinimized"), false).toBool());
|
||||||
|
|
||||||
|
ui.checkQuit->setChecked(_settings->value(QString::fromUtf8("doQuit"), false).toBool());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GeneralDialog::quit() const {
|
||||||
|
if(ui.checkQuit->isChecked()) return true;
|
||||||
|
return ui.checkQuit->isChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GeneralDialog::startMinimized() const {
|
bool GeneralDialog::startMinimized() const {
|
||||||
|
|
|
@ -47,6 +47,8 @@ public:
|
||||||
/** Loads the settings for this page */
|
/** Loads the settings for this page */
|
||||||
void load();
|
void load();
|
||||||
bool startMinimized() const;
|
bool startMinimized() const;
|
||||||
|
bool quit() const;
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
|
|
|
@ -499,13 +499,7 @@
|
||||||
<property name="contextMenuPolicy">
|
<property name="contextMenuPolicy">
|
||||||
<enum>Qt::NoContextMenu</enum>
|
<enum>Qt::NoContextMenu</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<property name="margin">
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QGroupBox" name="groupBox_2">
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
|
@ -539,14 +533,30 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<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">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>401</width>
|
<width>178</width>
|
||||||
<height>91</height>
|
<height>95</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue