mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-23 14:41:04 -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);
|
||||
#endif
|
||||
menu->addAction(_prefsAct);
|
||||
//menu->addAction(_smplayerAct);
|
||||
menu->addAction(_helpAct);
|
||||
menu->addSeparator();
|
||||
menu->addAction(QIcon(IMAGE_MINIMIZE), tr("Minimize"), this, SLOT(showMinimized()));
|
||||
|
@ -499,7 +498,6 @@ MainWindow::~MainWindow()
|
|||
{
|
||||
delete _bandwidthGraph;
|
||||
delete _messengerwindowAct;
|
||||
//delete _smplayerAct;
|
||||
delete _preferencesWindow;
|
||||
}
|
||||
|
||||
|
@ -524,9 +522,6 @@ void MainWindow::createActions()
|
|||
_appAct = new QAction(QIcon(IMAGE_UNFINISHED), tr("Applications"), this);
|
||||
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);
|
||||
connect(_helpAct, SIGNAL(triggered()), this, SLOT(showHelpDialog()));
|
||||
|
||||
|
@ -538,6 +533,9 @@ void MainWindow::createActions()
|
|||
*/
|
||||
void MainWindow::doQuit()
|
||||
{
|
||||
|
||||
if(!_settings->value(QString::fromUtf8("doQuit"), false).toBool())
|
||||
{
|
||||
QString queryWrn;
|
||||
queryWrn.clear();
|
||||
queryWrn.append(tr("Do you really want to exit RetroShare ?"));
|
||||
|
@ -549,6 +547,10 @@ void MainWindow::doQuit()
|
|||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
else
|
||||
rsicontrol->rsGlobalShutDown();
|
||||
qApp->quit();
|
||||
}
|
||||
|
||||
void MainWindow::closeEvent(QCloseEvent *e)
|
||||
|
|
|
@ -56,6 +56,8 @@ GeneralDialog::save(QString &errmsg)
|
|||
{
|
||||
_settings->setValue(QString::fromUtf8("StartMinimized"), startMinimized());
|
||||
|
||||
_settings->setValue(QString::fromUtf8("doQuit"), quit());
|
||||
|
||||
_settings->setRunRetroshareOnBoot(
|
||||
ui.chkRunRetroshareAtSystemStartup->isChecked());
|
||||
|
||||
|
@ -71,6 +73,13 @@ GeneralDialog::load()
|
|||
|
||||
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 {
|
||||
|
|
|
@ -47,6 +47,8 @@ public:
|
|||
/** Loads the settings for this page */
|
||||
void load();
|
||||
bool startMinimized() const;
|
||||
bool quit() const;
|
||||
|
||||
|
||||
private slots:
|
||||
|
||||
|
|
|
@ -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…
Add table
Add a link
Reference in a new issue