fixed startMinized now it works

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1209 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2009-05-09 13:38:46 +00:00
parent dab5ae98f8
commit 281f4b95f3
3 changed files with 30 additions and 63 deletions

View File

@ -1,7 +1,7 @@
/**************************************************************** /****************************************************************
* This file is distributed under the following license: * This file is distributed under the following license:
* *
* Copyright (c) 2006-2007, crypton * Copyright (c) 2006-2007, crypton
* Copyright (c) 2006, Matt Edman, Justin Hipple * Copyright (c) 2006, Matt Edman, Justin Hipple
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
@ -35,17 +35,7 @@ GeneralDialog::GeneralDialog(QWidget *parent)
/* Create RshareSettings object */ /* Create RshareSettings object */
_settings = new RshareSettings(); _settings = new RshareSettings();
if (QSystemTrayIcon::isSystemTrayAvailable()){
/* Check if we are supposed to show our main window on startup */
ui.chkShowOnStartup->setChecked(_settings->showMainWindowAtStart());
if (ui.chkShowOnStartup->isChecked())
show();
} else {
/* Don't let people hide the main window, since that's all they have. */
ui.chkShowOnStartup->hide();
show();
}
/* Hide platform specific features */ /* Hide platform specific features */
#ifndef Q_WS_WIN #ifndef Q_WS_WIN
ui.chkRunRetroshareAtSystemStartup->setVisible(false); ui.chkRunRetroshareAtSystemStartup->setVisible(false);

View File

@ -5,8 +5,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>431</width> <width>413</width>
<height>250</height> <height>267</height>
</rect> </rect>
</property> </property>
<property name="minimumSize" > <property name="minimumSize" >
@ -552,53 +552,27 @@
</size> </size>
</property> </property>
<property name="title" > <property name="title" >
<string>Misc</string> <string>Startup</string>
</property> </property>
<widget class="QCheckBox" name="chkShowOnStartup" > <layout class="QGridLayout" >
<property name="geometry" > <item row="0" column="0" >
<rect> <widget class="QCheckBox" name="chkRunRetroshareAtSystemStartup" >
<x>10</x> <property name="text" >
<y>40</y> <string>Start RetroShare when my system starts</string>
<width>401</width> </property>
<height>20</height> </widget>
</rect> </item>
</property> <item row="1" column="0" >
<property name="text" > <widget class="QCheckBox" name="checkStartMinimized" >
<string>Show MainWindow at Startup</string> <property name="text" >
</property> <string>Start minimized</string>
<property name="checked" > </property>
<bool>false</bool> <property name="checked" >
</property> <bool>true</bool>
</widget> </property>
<widget class="QCheckBox" name="checkStartMinimized" > </widget>
<property name="geometry" > </item>
<rect> </layout>
<x>10</x>
<y>60</y>
<width>401</width>
<height>20</height>
</rect>
</property>
<property name="text" >
<string>Start minimized</string>
</property>
<property name="checked" >
<bool>true</bool>
</property>
</widget>
<widget class="QCheckBox" name="chkRunRetroshareAtSystemStartup" >
<property name="geometry" >
<rect>
<x>10</x>
<y>20</y>
<width>411</width>
<height>18</height>
</rect>
</property>
<property name="text" >
<string>Start RetroShare when my system starts</string>
</property>
</widget>
</widget> </widget>
</item> </item>
<item row="2" column="0" > <item row="2" column="0" >

View File

@ -25,6 +25,7 @@
#include <gui/MainWindow.h> #include <gui/MainWindow.h>
#include <gui/StartDialog.h> #include <gui/StartDialog.h>
#include <gui/GenCertDialog.h> #include <gui/GenCertDialog.h>
#include <gui/Preferences/GeneralDialog.h>
#include <gui/Preferences/rsharesettings.h> #include <gui/Preferences/rsharesettings.h>
#include <gui/connect/ConfCertDialog.h> #include <gui/connect/ConfCertDialog.h>
@ -59,7 +60,7 @@ int main(int argc, char *argv[])
bool startMinimised = RsConfigStartMinimised(config); bool startMinimised = RsConfigStartMinimised(config);
*/ */
bool startMinimised = false; //bool startMinimized = false;
/* Setup The GUI Stuff */ /* Setup The GUI Stuff */
Rshare rshare(args, argc, argv, Rshare rshare(args, argc, argv,
@ -176,7 +177,9 @@ int main(int argc, char *argv[])
QObject::connect(ConfCertDialog::instance(),SIGNAL(configChanged()),w->networkDialog,SLOT(insertConnect())) ; QObject::connect(ConfCertDialog::instance(),SIGNAL(configChanged()),w->networkDialog,SLOT(insertConnect())) ;
/* only show window, if not startMinimized */ /* only show window, if not startMinimized */
if (!startMinimised) RshareSettings *_settings = new RshareSettings();
if(!_settings->value(QString::fromUtf8("StartMinimized"), false).toBool())
{ {
w->show(); w->show();