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

View File

@ -158,7 +158,7 @@ p, li { white-space: pre-wrap; }
<string notr="true"/>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="pageWelcome">
<property name="styleSheet">
@ -863,14 +863,14 @@ p, li { white-space: pre-wrap; }
</item>
<item row="3" column="0">
<layout class="QGridLayout" name="gridLayout_19">
<item row="2" column="0">
<item row="5" column="0">
<widget class="QCheckBox" name="checkBoxQuit">
<property name="text">
<string>Do not show a message when Closing RetroShare</string>
</property>
</widget>
</item>
<item row="1" column="0">
<item row="4" column="0">
<widget class="QCheckBox" name="checkBoxStartMinimized">
<property name="text">
<string>Start Minimized</string>
@ -884,6 +884,33 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</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>
</item>
<item row="10" column="0">

View File

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

View File

@ -511,7 +511,7 @@
<property name="title">
<string>Startup</string>
</property>
<layout class="QGridLayout">
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QCheckBox" name="chkRunRetroshareAtSystemStartup">
<property name="text">
@ -519,7 +519,7 @@
</property>
</widget>
</item>
<item row="1" column="0">
<item row="5" column="0">
<widget class="QCheckBox" name="checkStartMinimized">
<property name="text">
<string>Start minimized</string>
@ -529,6 +529,33 @@
</property>
</widget>
</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>
</widget>
</item>

View File

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

View File

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

View File

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

View File

@ -4231,17 +4231,22 @@ Fill in your GPG password when asked, to sign your new key.</source>
<context>
<name>GeneralPage</name>
<message>
<location filename="../gui/settings/GeneralPage.ui" line="+561"/>
<location filename="../gui/settings/GeneralPage.ui" line="+588"/>
<source>Auto Login</source>
<translation>Automatische Anmeldung</translation>
</message>
<message>
<location line="-49"/>
<location line="-76"/>
<source>Startup</source>
<translation>Programmstart</translation>
</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>
<translation>Verschiedenes</translation>
</message>
@ -4258,20 +4263,20 @@ Fill in your GPG password when asked, to sign your new key.</source>
<message>
<location line="+46"/>
<source> seconds</source>
<translation type="unfinished"></translation>
<translation>Sekunden</translation>
</message>
<message>
<location line="-72"/>
<location line="-99"/>
<source>Start minimized</source>
<translation>Minimiert starten</translation>
</message>
<message>
<location line="-7"/>
<source>Start RetroShare when my system starts</source>
<translation>Starte mit Windows</translation>
<translation>Starte RetroShare mit dem System</translation>
</message>
<message>
<location line="+66"/>
<location line="+93"/>
<source>Idle</source>
<translation>Untätig</translation>
</message>
@ -8841,12 +8846,12 @@ p, li { white-space: pre-wrap; }
<location line="-494"/>
<location line="+269"/>
<location line="+235"/>
<location line="+178"/>
<location line="+205"/>
<source>Exit</source>
<translation>Beenden</translation>
</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>
<translation>Für die beste Leistung muss RetroShare ein wenig über Ihre Internetverbindung erfahren.</translation>
</message>
@ -8894,12 +8899,12 @@ p, li { white-space: pre-wrap; }
<message>
<location line="+94"/>
<location line="+235"/>
<location line="+178"/>
<location line="+205"/>
<source>&lt; Back</source>
<translation>&lt; Zurück</translation>
</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;
&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; }
@ -8974,12 +8979,17 @@ p, li { white-space: pre-wrap; }
<translation>Starte RetroShare mit dem System.</translation>
</message>
<message>
<location line="+63"/>
<source>Finish</source>
<translation>Ende</translation>
<location line="+25"/>
<source>Start minimized on system start</source>
<translation>Minimieren beim Starten mit dem System</translation>
</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>
<translation>Wählen Sie ein Ordner zum Freigeben</translation>
</message>
@ -8999,7 +9009,7 @@ p, li { white-space: pre-wrap; }
<translation>Warnung!</translation>
</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;
&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; }