Set the OK button as default in the settings window.

Added a new setting for Windows to start RetroShare minimized on system start.
Fixed german language.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3907 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-12-11 22:46:14 +00:00
parent 3ecb987a4e
commit 69373cc69b
9 changed files with 1062 additions and 991 deletions

View File

@ -64,7 +64,6 @@ QuickStartWizard::QuickStartWizard(QWidget *parent) :
/* Hide platform specific features */ /* Hide platform specific features */
#ifndef Q_WS_WIN #ifndef Q_WS_WIN
ui.checkBoxRunRetroshareAtSystemStartup->setVisible(false); ui.checkBoxRunRetroshareAtSystemStartup->setVisible(false);
#endif #endif
} }
@ -183,7 +182,7 @@ void QuickStartWizard::on_pushButtonSystemFinish_clicked()
{ {
Settings->setValue(QString::fromUtf8("StartMinimized"), startMinimized()); Settings->setValue(QString::fromUtf8("StartMinimized"), startMinimized());
Settings->setValue(QString::fromUtf8("doQuit"), quitbox()); Settings->setValue(QString::fromUtf8("doQuit"), quitbox());
Settings->setRunRetroshareOnBoot(ui.checkBoxRunRetroshareAtSystemStartup->isChecked()); Settings->setRunRetroshareOnBoot(ui.checkBoxRunRetroshareAtSystemStartup->isChecked(), ui.chkRunRetroshareAtSystemStartupMinimized->isChecked());
saveChanges(); saveChanges();
@ -200,7 +199,6 @@ void QuickStartWizard::on_pushButtonSharesAdd_clicked()
/* select a dir /* select a dir
*/ */
QString qdir = QFileDialog::getExistingDirectory(this, tr("Select A Folder To Share"), "", QString qdir = QFileDialog::getExistingDirectory(this, tr("Select A Folder To Share"), "",
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
@ -363,7 +361,9 @@ bool QuickStartWizard::messageBoxOk(QString msg)
void void
QuickStartWizard::loadGeneral() QuickStartWizard::loadGeneral()
{ {
ui.checkBoxRunRetroshareAtSystemStartup->setChecked(Settings->runRetroshareOnBoot()); bool minimized;
ui.checkBoxRunRetroshareAtSystemStartup->setChecked(Settings->runRetroshareOnBoot(minimized));
ui.chkRunRetroshareAtSystemStartupMinimized->setChecked(minimized);
ui.checkBoxStartMinimized->setChecked(Settings->value(QString::fromUtf8("StartMinimized"), false).toBool()); ui.checkBoxStartMinimized->setChecked(Settings->value(QString::fromUtf8("StartMinimized"), false).toBool());
ui.checkBoxQuit->setChecked(Settings->value(QString::fromUtf8("doQuit"), false).toBool()); ui.checkBoxQuit->setChecked(Settings->value(QString::fromUtf8("doQuit"), false).toBool());

View File

@ -158,7 +158,7 @@ p, li { white-space: pre-wrap; }
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="pageWelcome"> <widget class="QWidget" name="pageWelcome">
<property name="styleSheet"> <property name="styleSheet">
@ -863,14 +863,14 @@ p, li { white-space: pre-wrap; }
</item> </item>
<item row="3" column="0"> <item row="3" column="0">
<layout class="QGridLayout" name="gridLayout_19"> <layout class="QGridLayout" name="gridLayout_19">
<item row="2" column="0"> <item row="5" column="0">
<widget class="QCheckBox" name="checkBoxQuit"> <widget class="QCheckBox" name="checkBoxQuit">
<property name="text"> <property name="text">
<string>Do not show a message when Closing RetroShare</string> <string>Do not show a message when Closing RetroShare</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="4" column="0">
<widget class="QCheckBox" name="checkBoxStartMinimized"> <widget class="QCheckBox" name="checkBoxStartMinimized">
<property name="text"> <property name="text">
<string>Start Minimized</string> <string>Start Minimized</string>
@ -884,6 +884,33 @@ p, li { white-space: pre-wrap; }
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="chkRunRetroshareAtSystemStartupMinimized">
<property name="text">
<string>Start minimized on system start</string>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</item> </item>
<item row="10" column="0"> <item row="10" column="0">

View File

@ -39,11 +39,9 @@ GeneralPage::GeneralPage(QWidget * parent, Qt::WFlags flags)
/* Hide platform specific features */ /* Hide platform specific features */
#ifndef Q_WS_WIN #ifndef Q_WS_WIN
ui.chkRunRetroshareAtSystemStartup->setVisible(false); ui.chkRunRetroshareAtSystemStartup->setVisible(false);
#endif #endif
ui.autoLogin->setChecked(RsInit::getAutoLogin()); ui.autoLogin->setChecked(RsInit::getAutoLogin());
} }
/** Destructor */ /** Destructor */
@ -61,8 +59,7 @@ GeneralPage::save(QString &errmsg)
Settings->setValue(QString::fromUtf8("ClosetoTray"), closetoTray()); Settings->setValue(QString::fromUtf8("ClosetoTray"), closetoTray());
Settings->setRunRetroshareOnBoot( Settings->setRunRetroshareOnBoot(ui.chkRunRetroshareAtSystemStartup->isChecked(), ui.chkRunRetroshareAtSystemStartupMinimized->isChecked());
ui.chkRunRetroshareAtSystemStartup->isChecked());
Settings->setMaxTimeBeforeIdle(ui.spinBox->value()); Settings->setMaxTimeBeforeIdle(ui.spinBox->value());
@ -73,7 +70,9 @@ GeneralPage::save(QString &errmsg)
void void
GeneralPage::load() GeneralPage::load()
{ {
ui.chkRunRetroshareAtSystemStartup->setChecked(Settings->runRetroshareOnBoot()); bool minimized;
ui.chkRunRetroshareAtSystemStartup->setChecked(Settings->runRetroshareOnBoot(minimized));
ui.chkRunRetroshareAtSystemStartupMinimized->setChecked(minimized);
ui.checkStartMinimized->setChecked(Settings->value(QString::fromUtf8("StartMinimized"), false).toBool()); ui.checkStartMinimized->setChecked(Settings->value(QString::fromUtf8("StartMinimized"), false).toBool());
@ -82,8 +81,6 @@ GeneralPage::load()
ui.checkClosetoTray->setChecked(Settings->value(QString::fromUtf8("ClosetoTray"), false).toBool()); ui.checkClosetoTray->setChecked(Settings->value(QString::fromUtf8("ClosetoTray"), false).toBool());
ui.spinBox->setValue(Settings->getMaxTimeBeforeIdle()); ui.spinBox->setValue(Settings->getMaxTimeBeforeIdle());
} }
bool GeneralPage::quit() const { bool GeneralPage::quit() const {
@ -101,7 +98,6 @@ bool GeneralPage::closetoTray() const {
return ui.checkClosetoTray->isChecked(); return ui.checkClosetoTray->isChecked();
} }
/** Called when the "show on startup" checkbox is toggled. */ /** Called when the "show on startup" checkbox is toggled. */
void void
GeneralPage::toggleShowOnStartup(bool checked) GeneralPage::toggleShowOnStartup(bool checked)

View File

@ -511,7 +511,7 @@
<property name="title"> <property name="title">
<string>Startup</string> <string>Startup</string>
</property> </property>
<layout class="QGridLayout"> <layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QCheckBox" name="chkRunRetroshareAtSystemStartup"> <widget class="QCheckBox" name="chkRunRetroshareAtSystemStartup">
<property name="text"> <property name="text">
@ -519,7 +519,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="5" column="0">
<widget class="QCheckBox" name="checkStartMinimized"> <widget class="QCheckBox" name="checkStartMinimized">
<property name="text"> <property name="text">
<string>Start minimized</string> <string>Start minimized</string>
@ -529,6 +529,33 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="chkRunRetroshareAtSystemStartupMinimized">
<property name="text">
<string>Start minimized on system start</string>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>

View File

@ -424,14 +424,19 @@ void RshareSettings::setPrivateChatHistoryCount(int value)
/** Returns true if RetroShare is set to run on system boot. */ /** Returns true if RetroShare is set to run on system boot. */
bool bool
RshareSettings::runRetroshareOnBoot() RshareSettings::runRetroshareOnBoot(bool &minimized)
{ {
minimized = false;
#if defined(Q_WS_WIN) #if defined(Q_WS_WIN)
if (!win32_registry_get_key_value(STARTUP_REG_KEY, RETROSHARE_REG_KEY).isEmpty()) { QString value = win32_registry_get_key_value(STARTUP_REG_KEY, RETROSHARE_REG_KEY);
if (!value.isEmpty()) {
/* Simple check for "-m" */
minimized = value.contains(" -m");
return true; return true;
} else {
return false;
} }
return false;
#else #else
/* Platforms other than windows aren't supported yet */ /* Platforms other than windows aren't supported yet */
return false; return false;
@ -440,14 +445,17 @@ RshareSettings::runRetroshareOnBoot()
/** If <b>run</b> is set to true, then RetroShare will run on system boot. */ /** If <b>run</b> is set to true, then RetroShare will run on system boot. */
void void
RshareSettings::setRunRetroshareOnBoot(bool run) RshareSettings::setRunRetroshareOnBoot(bool run, bool minimized)
{ {
#if defined(Q_WS_WIN) #if defined(Q_WS_WIN)
if (run) { if (run) {
win32_registry_set_key_value(STARTUP_REG_KEY, RETROSHARE_REG_KEY, QString value = "\"" + QDir::convertSeparators(QCoreApplication::applicationFilePath()) + "\"";
QString("\"" +
QDir::convertSeparators(QCoreApplication::applicationFilePath())) + if (minimized) {
"\""); value += " -m";
}
win32_registry_set_key_value(STARTUP_REG_KEY, RETROSHARE_REG_KEY, value);
} else { } else {
win32_registry_remove_key(STARTUP_REG_KEY, RETROSHARE_REG_KEY); win32_registry_remove_key(STARTUP_REG_KEY, RETROSHARE_REG_KEY);
} }

View File

@ -100,10 +100,10 @@ public:
void setShowMainWindowAtStart(bool show); void setShowMainWindowAtStart(bool show);
/** Returns true if RetroShare should start on system boot. */ /** Returns true if RetroShare should start on system boot. */
bool runRetroshareOnBoot(); bool runRetroshareOnBoot(bool &minimized);
/** Set whether to run RetroShare on system boot. */ /** Set whether to run RetroShare on system boot. */
void setRunRetroshareOnBoot(bool run); void setRunRetroshareOnBoot(bool run, bool minimized);
/* Get the destination log file. */ /* Get the destination log file. */
QString getLogFile(); QString getLogFile();

View File

@ -289,6 +289,9 @@
<property name="text"> <property name="text">
<string>OK</string> <string>OK</string>
</property> </property>
<property name="default">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>

View File

@ -4231,17 +4231,22 @@ Fill in your GPG password when asked, to sign your new key.</source>
<context> <context>
<name>GeneralPage</name> <name>GeneralPage</name>
<message> <message>
<location filename="../gui/settings/GeneralPage.ui" line="+561"/> <location filename="../gui/settings/GeneralPage.ui" line="+588"/>
<source>Auto Login</source> <source>Auto Login</source>
<translation>Automatische Anmeldung</translation> <translation>Automatische Anmeldung</translation>
</message> </message>
<message> <message>
<location line="-49"/> <location line="-76"/>
<source>Startup</source> <source>Startup</source>
<translation>Programmstart</translation> <translation>Programmstart</translation>
</message> </message>
<message> <message>
<location line="+26"/> <location line="+41"/>
<source>Start minimized on system start</source>
<translation>Minimieren beim Starten mit dem System</translation>
</message>
<message>
<location line="+12"/>
<source>Misc</source> <source>Misc</source>
<translation>Verschiedenes</translation> <translation>Verschiedenes</translation>
</message> </message>
@ -4258,20 +4263,20 @@ Fill in your GPG password when asked, to sign your new key.</source>
<message> <message>
<location line="+46"/> <location line="+46"/>
<source> seconds</source> <source> seconds</source>
<translation type="unfinished"></translation> <translation>Sekunden</translation>
</message> </message>
<message> <message>
<location line="-72"/> <location line="-99"/>
<source>Start minimized</source> <source>Start minimized</source>
<translation>Minimiert starten</translation> <translation>Minimiert starten</translation>
</message> </message>
<message> <message>
<location line="-7"/> <location line="-7"/>
<source>Start RetroShare when my system starts</source> <source>Start RetroShare when my system starts</source>
<translation>Starte mit Windows</translation> <translation>Starte RetroShare mit dem System</translation>
</message> </message>
<message> <message>
<location line="+66"/> <location line="+93"/>
<source>Idle</source> <source>Idle</source>
<translation>Untätig</translation> <translation>Untätig</translation>
</message> </message>
@ -8841,12 +8846,12 @@ p, li { white-space: pre-wrap; }
<location line="-494"/> <location line="-494"/>
<location line="+269"/> <location line="+269"/>
<location line="+235"/> <location line="+235"/>
<location line="+178"/> <location line="+205"/>
<source>Exit</source> <source>Exit</source>
<translation>Beenden</translation> <translation>Beenden</translation>
</message> </message>
<message> <message>
<location line="-622"/> <location line="-649"/>
<source>For best performance, RetroShare needs to know a little about your connection to the internet.</source> <source>For best performance, RetroShare needs to know a little about your connection to the internet.</source>
<translation>Für die beste Leistung muss RetroShare ein wenig über Ihre Internetverbindung erfahren.</translation> <translation>Für die beste Leistung muss RetroShare ein wenig über Ihre Internetverbindung erfahren.</translation>
</message> </message>
@ -8894,12 +8899,12 @@ p, li { white-space: pre-wrap; }
<message> <message>
<location line="+94"/> <location line="+94"/>
<location line="+235"/> <location line="+235"/>
<location line="+178"/> <location line="+205"/>
<source>&lt; Back</source> <source>&lt; Back</source>
<translation>&lt; Zurück</translation> <translation>&lt; Zurück</translation>
</message> </message>
<message> <message>
<location line="-331"/> <location line="-358"/>
<source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; }
@ -8974,12 +8979,17 @@ p, li { white-space: pre-wrap; }
<translation>Starte RetroShare mit dem System.</translation> <translation>Starte RetroShare mit dem System.</translation>
</message> </message>
<message> <message>
<location line="+63"/> <location line="+25"/>
<source>Finish</source> <source>Start minimized on system start</source>
<translation>Ende</translation> <translation>Minimieren beim Starten mit dem System</translation>
</message> </message>
<message> <message>
<location filename="../gui/QuickStartWizard.cpp" line="+204"/> <location line="+65"/>
<source>Finish</source>
<translation>Fertigstellen</translation>
</message>
<message>
<location filename="../gui/QuickStartWizard.cpp" line="+202"/>
<source>Select A Folder To Share</source> <source>Select A Folder To Share</source>
<translation>Wählen Sie ein Ordner zum Freigeben</translation> <translation>Wählen Sie ein Ordner zum Freigeben</translation>
</message> </message>
@ -8999,7 +9009,7 @@ p, li { white-space: pre-wrap; }
<translation>Warnung!</translation> <translation>Warnung!</translation>
</message> </message>
<message> <message>
<location filename="../gui/QuickStartWizard.ui" line="-748"/> <location filename="../gui/QuickStartWizard.ui" line="-775"/>
<source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; }