<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -196,7 +196,7 @@ BrowserMainWindow::BrowserMainWindow(QWidget *parent, Qt::WindowFlags flags)
     connect(m_tabWidget, SIGNAL(toolBarVisibilityChangeRequested(bool)),
             m_bookmarksToolbar, SLOT(setVisible(bool)));
     connect(m_tabWidget, SIGNAL(lastTabClosed()),
-            this, SLOT(close()));
+            this, SLOT(lastTabClosed()));
 
     updateWindowTitle();
     loadDefaultState();
@@ -384,6 +384,18 @@ bool BrowserMainWindow::restoreState(const QByteArray &amp;state)
     return true;
 }
 
+void BrowserMainWindow::lastTabClosed()
+{
+    QSettings settings;
+    settings.beginGroup(QLatin1String(&quot;tabs&quot;));
+    bool quit = settings.value(QLatin1String(&quot;quitAsLastTabClosed&quot;), true).toBool();
+
+    if (quit)
+        close();
+    else
+        m_tabWidget-&gt;makeNewTab(true);
+}
+
 QAction *BrowserMainWindow::showMenuBarAction() const
 {
     return m_viewShowMenuBarAction;</diff>
      <filename>src/browsermainwindow.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -115,6 +115,8 @@ protected:
 private slots:
     void save();
 
+    void lastTabClosed();
+
     void loadProgress(int);
     void updateStatusbar(const QString &amp;string);
     void updateWindowTitle(const QString &amp;title = QString());</diff>
      <filename>src/browsermainwindow.h</filename>
    </modified>
    <modified>
      <diff>@@ -230,6 +230,7 @@ void SettingsDialog::loadFromSettings()
 #if QT_VERSION &gt;= 0x040500
     oneCloseButton-&gt;setChecked(settings.value(QLatin1String(&quot;oneCloseButton&quot;),false).toBool());
 #endif
+    quitAsLastTabClosed-&gt;setChecked(settings.value(QLatin1String(&quot;quitAsLastTabClosed&quot;), true).toBool());
     openTargetBlankLinksIn-&gt;setCurrentIndex(settings.value(QLatin1String(&quot;openTargetBlankLinksIn&quot;), TabWidget::NewSelectedTab).toInt());
     openLinksFromAppsIn-&gt;setCurrentIndex(settings.value(QLatin1String(&quot;openLinksFromAppsIn&quot;), TabWidget::NewSelectedTab).toInt());
     settings.endGroup();
@@ -336,6 +337,7 @@ void SettingsDialog::saveToSettings()
 #if QT_VERSION &gt;= 0x040500
     settings.setValue(QLatin1String(&quot;oneCloseButton&quot;), oneCloseButton-&gt;isChecked());
 #endif
+    settings.setValue(QLatin1String(&quot;quitAsLastTabClosed&quot;), quitAsLastTabClosed-&gt;isChecked());
     settings.setValue(QLatin1String(&quot;openTargetBlankLinksIn&quot;), openTargetBlankLinksIn-&gt;currentIndex());
     settings.setValue(QLatin1String(&quot;openLinksFromAppsIn&quot;), openLinksFromAppsIn-&gt;currentIndex());
     settings.endGroup();</diff>
      <filename>src/settings.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -536,6 +536,16 @@
         &lt;/widget&gt;
        &lt;/item&gt;
        &lt;item&gt;
+        &lt;widget class=&quot;QCheckBox&quot; name=&quot;quitAsLastTabClosed&quot;&gt;
+         &lt;property name=&quot;text&quot;&gt;
+          &lt;string&gt;Quit the application when last tab is closed&lt;/string&gt;
+         &lt;/property&gt;
+         &lt;property name=&quot;checked&quot;&gt;
+          &lt;bool&gt;true&lt;/bool&gt;
+         &lt;/property&gt;
+        &lt;/widget&gt;
+       &lt;/item&gt;
+       &lt;item&gt;
         &lt;widget class=&quot;QGroupBox&quot; name=&quot;openLinksGroupBox&quot;&gt;
          &lt;property name=&quot;title&quot;&gt;
           &lt;string&gt;Opening links&lt;/string&gt;</diff>
      <filename>src/settings.ui</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1d50a96b3637337a4d6ccadd5477c40a37f2068f</id>
    </parent>
  </parents>
  <author>
    <name>Jakub Wieczorek</name>
    <email>faw217@gmail.com</email>
  </author>
  <url>http://github.com/Arora/arora/commit/ca6cf65947ca10ace90291efa6b7160c9bb6d2a3</url>
  <id>ca6cf65947ca10ace90291efa6b7160c9bb6d2a3</id>
  <committed-date>2009-05-03T10:33:01-07:00</committed-date>
  <authored-date>2009-04-14T03:42:45-07:00</authored-date>
  <message>Add a setting specifying if the application should quit when last tab is closed.
This addresses ticket #260.</message>
  <tree>403603e726fc03442b57948d663f6db8b1fd6f20</tree>
  <committer>
    <name>Jakub Wieczorek</name>
    <email>faw217@gmail.com</email>
  </committer>
</commit>
