Index: trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGLSettingsUpdate.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGLSettingsUpdate.h	(revision 10584)
+++ trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGLSettingsUpdate.h	(revision 10584)
@@ -0,0 +1,64 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * VBoxGLSettingsUpdate class declaration
+ */
+
+/*
+ * Copyright (C) 2006-2008 Sun Microsystems, Inc.
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+ * Clara, CA 95054 USA or visit http://www.sun.com if you need
+ * additional information or have any questions.
+ */
+
+#ifndef __VBoxGLSettingsUpdate_h__
+#define __VBoxGLSettingsUpdate_h__
+
+#include "VBoxSettingsPage.h"
+#include "VBoxGLSettingsUpdate.gen.h"
+
+class VBoxGLSettingsUpdate : public VBoxSettingsPage,
+                             public Ui::VBoxGLSettingsUpdate
+{
+    Q_OBJECT;
+
+public:
+
+    VBoxGLSettingsUpdate();
+
+protected:
+
+    void getFrom (const CSystemProperties &aProps,
+                  const VBoxGlobalSettings &aGs);
+    void putBackTo (CSystemProperties &aProps,
+                    VBoxGlobalSettings &aGs);
+
+    void setOrderAfter (QWidget *aWidget);
+
+    void retranslateUi();
+
+private slots:
+
+    void toggleUpdater (bool aOn);
+    void toggleType();
+    void activatedPeriod (int aIndex);
+
+private:
+
+    void showEvent (QShowEvent *aEvent);
+
+    QRadioButton *mLastSelected;
+    bool mSettingsChanged;
+};
+
+#endif // __VBoxGLSettingsUpdate_h__
+
Index: trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGLSettingsUpdate.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGLSettingsUpdate.cpp	(revision 10584)
+++ trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGLSettingsUpdate.cpp	(revision 10584)
@@ -0,0 +1,181 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * VBoxGLSettingsUpdate class implementation
+ */
+
+/*
+ * Copyright (C) 2006-2008 Sun Microsystems, Inc.
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+ * Clara, CA 95054 USA or visit http://www.sun.com if you need
+ * additional information or have any questions.
+ */
+
+#include "VBoxGLSettingsUpdate.h"
+#include "VBoxUpdateDlg.h"
+#include "VBoxGlobal.h"
+
+VBoxGLSettingsUpdate::VBoxGLSettingsUpdate()
+    : mLastSelected (0)
+    , mSettingsChanged (false)
+{
+    /* Apply UI decorations */
+    Ui::VBoxGLSettingsUpdate::setupUi (this);
+
+    /* Setup connections */
+    connect (mGbCheck, SIGNAL (toggled (bool)),
+             this, SLOT (toggleUpdater (bool)));
+    connect (mRbAuto, SIGNAL (clicked()), this, SLOT (toggleType()));
+    connect (mRbOncePer, SIGNAL (clicked()), this, SLOT (toggleType()));
+    connect (mCbOncePer, SIGNAL (activated (int)),
+             this, SLOT (activatedPeriod (int)));
+
+    /* Applying language settings */
+    retranslateUi();
+}
+
+void VBoxGLSettingsUpdate::getFrom (const CSystemProperties &,
+                                    const VBoxGlobalSettings &)
+{
+    VBoxUpdateData data (vboxGlobal().virtualBox().
+                         GetExtraData (VBoxDefs::GUI_UpdateDate));
+
+    if (data.index() == VBoxUpdateData::NeverCheck)
+    {
+        mGbCheck->setChecked (false);
+    }
+    else
+    {
+        mGbCheck->setChecked (true);
+
+        if (data.isAutomatic())
+        {
+            mRbAuto->setChecked (true);
+        }
+        else
+        {
+            mRbOncePer->setChecked (true);
+            Assert (data.index() >= 0);
+            mCbOncePer->setCurrentIndex (data.index());
+        }
+    }
+    mTxDate->setText (data.date());
+
+    mSettingsChanged = false;
+}
+
+void VBoxGLSettingsUpdate::putBackTo (CSystemProperties &,
+                                      VBoxGlobalSettings &)
+{
+    if (!mSettingsChanged)
+        return;
+
+    int index = -1;
+
+    if (!mGbCheck->isChecked())
+    {
+        index = VBoxUpdateData::NeverCheck;
+    }
+    else
+    {
+        if (mRbAuto->isChecked())
+            index = VBoxUpdateData::AutoCheck;
+        else
+            index = mCbOncePer->currentIndex();
+    }
+    Assert (index != -1);
+
+    VBoxUpdateData newData (index);
+
+    vboxGlobal().virtualBox().SetExtraData (VBoxDefs::GUI_UpdateDate,
+                                            newData.data());
+}
+
+void VBoxGLSettingsUpdate::setOrderAfter (QWidget *aWidget)
+{
+    setTabOrder (aWidget, mGbCheck);
+    setTabOrder (mGbCheck, mRbAuto);
+    setTabOrder (mRbAuto, mRbOncePer);
+    setTabOrder (mRbOncePer, mCbOncePer);
+}
+
+void VBoxGLSettingsUpdate::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::VBoxGLSettingsUpdate::retranslateUi (this);
+
+    /* Retranslate mCbOncePer combobox */
+    int ci = mCbOncePer->currentIndex();
+    mCbOncePer->clear();
+    VBoxUpdateData::populate();
+    mCbOncePer->insertItems (0, VBoxUpdateData::list());
+    mCbOncePer->setCurrentIndex (ci == -1 ? 0 : ci);
+}
+
+void VBoxGLSettingsUpdate::toggleUpdater (bool aOn)
+{
+    /* Toggle auto-exclusiveness on/off to let the buttons be
+     * unchecked both in case of group-box is not checked and
+     * exclusively checked in case of group-box is checked. */
+    mRbAuto->setAutoExclusive (aOn);
+    mRbOncePer->setAutoExclusive (aOn);
+
+    /* Enable/disable the sub widget */
+    mGbCheckContent->setEnabled (aOn);
+
+    /* Toggle both buttons off when the group box unchecked. */
+    if (!aOn)
+    {
+        mLastSelected = mRbOncePer->isChecked() ? mRbOncePer : mRbAuto;
+        mRbAuto->blockSignals (true);
+        mRbOncePer->blockSignals (true);
+        mRbAuto->setChecked (false);
+        mRbOncePer->setChecked (false);
+        mRbAuto->blockSignals (false);
+        mRbOncePer->blockSignals (false);
+        activatedPeriod (VBoxUpdateData::NeverCheck);
+    }
+    /* Toggle last checked button on when the group box checked. */
+    else if (!mRbAuto->isChecked() && !mRbOncePer->isChecked())
+    {
+        mLastSelected->blockSignals (true);
+        mLastSelected->setChecked (true);
+        mLastSelected->blockSignals (false);
+        toggleType();
+    }
+}
+
+void VBoxGLSettingsUpdate::toggleType()
+{
+    mCbOncePer->setEnabled (mRbOncePer->isChecked());
+    activatedPeriod (mRbAuto->isChecked() ?
+        VBoxUpdateData::AutoCheck : mCbOncePer->currentIndex());
+}
+
+void VBoxGLSettingsUpdate::activatedPeriod (int aIndex)
+{
+    VBoxUpdateData data (aIndex);
+    mTxDate->setText (data.date());
+    mSettingsChanged = true;
+}
+
+void VBoxGLSettingsUpdate::showEvent (QShowEvent *aEvent)
+{
+    VBoxSettingsPage::showEvent (aEvent);
+
+    /* That little hack allows avoid one of qt4 children focusing bug */
+    QWidget *current = QApplication::focusWidget();
+    mCbOncePer->setFocus (Qt::TabFocusReason);
+    if (current)
+        current->setFocus (Qt::TabFocusReason);
+}
+
Index: trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxGLSettingsUpdate.ui
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxGLSettingsUpdate.ui	(revision 10584)
+++ trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxGLSettingsUpdate.ui	(revision 10584)
@@ -0,0 +1,205 @@
+<ui version="4.0" >
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+ Copyright (C) 2008 Sun Microsystems, Inc.
+
+ This file is part of VirtualBox Open Source Edition (OSE), as
+ available from http://www.virtualbox.org. This file is free software;
+ you can redistribute it and/or modify it under the terms of the GNU
+ General Public License (GPL) as published by the Free Software
+ Foundation, in version 2 as it comes in the "COPYING" file of the
+ VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+ Clara, CA 95054 USA or visit http://www.sun.com if you need
+ additional information or have any questions.
+ </comment>
+ <class>VBoxGLSettingsUpdate</class>
+ <widget class="QWidget" name="VBoxGLSettingsUpdate" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>310</width>
+    <height>183</height>
+   </rect>
+  </property>
+  <layout class="QGridLayout" >
+   <property name="leftMargin" >
+    <number>0</number>
+   </property>
+   <property name="topMargin" >
+    <number>0</number>
+   </property>
+   <property name="rightMargin" >
+    <number>0</number>
+   </property>
+   <property name="bottomMargin" >
+    <number>0</number>
+   </property>
+   <item row="0" column="1" colspan="2" >
+    <widget class="QCheckBox" name="mGbCheck" >
+     <property name="text" >
+      <string>&amp;Check for a new version</string>
+     </property>
+     <property name="checked" >
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeType" >
+      <enum>QSizePolicy::Fixed</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>40</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="1" column="1" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeType" >
+      <enum>QSizePolicy::Fixed</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="1" column="2" >
+    <widget class="QWidget" native="1" name="mGbCheckContent" >
+     <layout class="QGridLayout" >
+      <property name="leftMargin" >
+       <number>0</number>
+      </property>
+      <property name="topMargin" >
+       <number>0</number>
+      </property>
+      <property name="rightMargin" >
+       <number>0</number>
+      </property>
+      <property name="bottomMargin" >
+       <number>0</number>
+      </property>
+      <property name="verticalSpacing" >
+       <number>0</number>
+      </property>
+      <item row="0" column="0" >
+       <widget class="QRadioButton" name="mRbAuto" >
+        <property name="text" >
+         <string>On &amp;startup</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0" >
+       <widget class="QRadioButton" name="mRbOncePer" >
+        <property name="text" >
+         <string>&amp;Once per</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1" >
+       <layout class="QHBoxLayout" >
+        <property name="spacing" >
+         <number>0</number>
+        </property>
+        <item>
+         <spacer>
+          <property name="orientation" >
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeType" >
+           <enum>QSizePolicy::Fixed</enum>
+          </property>
+          <property name="sizeHint" >
+           <size>
+            <width>16</width>
+            <height>16</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+        <item>
+         <widget class="QComboBox" name="mCbOncePer" />
+        </item>
+        <item>
+         <spacer>
+          <property name="orientation" >
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" >
+           <size>
+            <width>0</width>
+            <height>16</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="2" column="1" colspan="2" >
+    <layout class="QHBoxLayout" >
+     <property name="spacing" >
+      <number>10</number>
+     </property>
+     <item>
+      <widget class="QLabel" name="mLbDate" >
+       <property name="sizePolicy" >
+        <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="text" >
+        <string>Next check:</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLabel" name="mTxDate" >
+       <property name="sizePolicy" >
+        <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item row="3" column="2" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
