]> git.sesse.net Git - vlc/commitdiff
A bit more modern version of the About dialog
authorJean-Baptiste Kempf <jb@videolan.org>
Tue, 16 Apr 2013 00:31:54 +0000 (02:31 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 16 Apr 2013 00:42:29 +0000 (02:42 +0200)
modules/gui/qt4/dialogs/help.cpp
modules/gui/qt4/dialogs/help.hpp
modules/gui/qt4/ui/about.ui
modules/gui/qt4/vlc.qrc

index e2008a78062116f13ad6dc0f9c2bd37eacfd18ec..e6fb2179b39aa3f270946f9b17592b95f3265c06 100644 (file)
@@ -83,53 +83,51 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf)
 {
     /* Build UI */
     ui.setupUi( this );
-    ui.closeButtonBox->addButton(
-        new QPushButton( qtr("&Close"), this ), QDialogButtonBox::RejectRole );
-
     setWindowTitle( qtr( "About" ) );
     setWindowRole( "vlc-about" );
-    setMinimumSize( 600, 500 );
-    resize( 600, 500 );
     setWindowModality( Qt::WindowModal );
 
-    CONNECT( ui.closeButtonBox, rejected(), this, close() );
-    ui.closeButtonBox->setFocus();
-
-    ui.introduction->setText(
-            qtr( "VLC media player" ) + qfu( " " VERSION_MESSAGE ) );
-
+    ui.version->setText(qfu( " " VERSION_MESSAGE ) );
+#if 0
     if( QDate::currentDate().dayOfYear() >= QT_XMAS_JOKE_DAY && var_InheritBool( p_intf, "qt-icon-change" ) )
         ui.iconVLC->setPixmap( QPixmap( ":/logo/vlc128-xmas.png" ) );
     else
         ui.iconVLC->setPixmap( QPixmap( ":/logo/vlc128.png" ) );
+#endif
 
-    /* Main Introduction */
-    ui.infoLabel->setText(
-            qtr( "VLC media player is a free media player, "
-                "encoder and streamer that can read from files, "
-                "CDs, DVDs, network streams, capture cards and even more!\n"
-                "VLC uses its internal codecs and works on essentially every "
-                "popular platform.\n\n" )
-            + qtr( "This version of VLC was compiled by:\n" )
-            + qfu( VLC_CompileBy() )+ " on " + qfu( VLC_CompileHost() ) +
-            + " ("__DATE__" "__TIME__").\n"
-            + qtr( "Compiler: " ) + qfu( VLC_Compiler() ) + ".\n"
-            + qtr( "You are using the Qt Interface.\n\n" )
-            + qtr( "Copyright (C) " ) + COPYRIGHT_YEARS
-            + qtr( " by the VideoLAN Team.\n" )
-            + "<a href=\"http://www.videolan.org\">http://www.videolan.org</a>" );
-
-    /* Be translators friendly: Convert to rich text */
-    ui.infoLabel->setText( ui.infoLabel->text().replace( "\n", "<br/>" ) );
+#if 0
+    ifdef UPDATE_CHECK
+#else
+    ui.update->hide();
+#endif
 
     /* GPL License */
-    ui.licenseEdit->setText( qfu( psz_license ) );
+    ui.licensePage->setText( qfu( psz_license ) );
 
     /* People who helped */
-    ui.thanksEdit->setText( qfu( psz_thanks ) );
+    ui.creditPage->setText( qfu( psz_thanks ) );
 
     /* People who wrote the software */
-    ui.authorsEdit->setText( qfu( psz_authors ) );
+    ui.authorsPage->setText( qfu( psz_authors ) );
+
+    BUTTONACT(ui.licenseButton, showLicense() );
+    BUTTONACT(ui.authorsButton, showAuthors() );
+    BUTTONACT(ui.creditsButton,  showCredit() );
+}
+
+void AboutDialog::showLicense()
+{
+    ui.stackedWidget->setCurrentWidget( ui.licensePage );
+}
+
+void AboutDialog::showAuthors()
+{
+    ui.stackedWidget->setCurrentWidget( ui.authorsPage );
+}
+
+void AboutDialog::showCredit()
+{
+    ui.stackedWidget->setCurrentWidget( ui.creditPage );
 }
 
 #ifdef UPDATE_CHECK
index ca39bc3099695318ca4b7d9462e10de305d6222c..11b8fe1b59c83d666b0eeb42128364943c31ba83 100644 (file)
@@ -58,9 +58,12 @@ private:
     Ui::aboutWidget ui;
 
 public slots:
-    virtual void close() { toggleVisible(); }
-
     friend class    Singleton<AboutDialog>;
+
+private slots:
+    void showLicense();
+    void showAuthors();
+    void showCredit();
 };
 
 #ifdef UPDATE_CHECK
index c280c470d7911a42ba87b2d65213e9c0e6b2574d..316ccb6bda99f7909dcbdcdc802c8dfcac357fb1 100644 (file)
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>520</width>
-    <height>357</height>
+    <width>744</width>
+    <height>360</height>
    </rect>
   </property>
   <property name="windowTitle">
-   <string>About</string>
+   <string>Dialog</string>
   </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <item row="0" column="0">
-    <widget class="QTabWidget" name="tabWidget">
-     <property name="currentIndex">
-      <number>0</number>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <property name="spacing">
+    <number>0</number>
+   </property>
+   <property name="margin">
+    <number>0</number>
+   </property>
+   <item>
+    <widget class="QFrame" name="horizontalFrame">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
      </property>
-     <widget class="QWidget" name="tab">
-      <attribute name="title">
-       <string>Version</string>
-      </attribute>
-      <layout class="QGridLayout" name="gridLayout_2">
-       <item row="0" column="1">
-        <widget class="QLabel" name="introduction">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="minimumSize">
-          <size>
-           <width>0</width>
-           <height>40</height>
-          </size>
-         </property>
-         <property name="font">
-          <font>
-           <weight>75</weight>
-           <bold>true</bold>
-          </font>
-         </property>
-         <property name="text">
-          <string notr="true">introduction</string>
-         </property>
-         <property name="textInteractionFlags">
-          <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="1">
-        <widget class="QLabel" name="infoLabel">
+     <property name="minimumSize">
+      <size>
+       <width>0</width>
+       <height>300</height>
+      </size>
+     </property>
+     <property name="styleSheet">
+      <string notr="true">background-color: rgb(222, 222, 222);
+background-color: rgb(245, 245, 245);</string>
+     </property>
+     <layout class="QGridLayout" name="gridLayout">
+      <item row="0" column="0" rowspan="6">
+       <widget class="QLabel" name="VLCcone">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>247</width>
+          <height>300</height>
+         </size>
+        </property>
+        <property name="autoFillBackground">
+         <bool>false</bool>
+        </property>
+        <property name="lineWidth">
+         <number>0</number>
+        </property>
+        <property name="text">
+         <string/>
+        </property>
+        <property name="textFormat">
+         <enum>Qt::PlainText</enum>
+        </property>
+        <property name="pixmap">
+         <pixmap>:/logo/vlc256.png</pixmap>
+        </property>
+        <property name="scaledContents">
+         <bool>false</bool>
+        </property>
+        <property name="margin">
+         <number>20</number>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="2" rowspan="4">
+       <widget class="QStackedWidget" name="stackedWidget">
+        <property name="lineWidth">
+         <number>0</number>
+        </property>
+        <property name="currentIndex">
+         <number>0</number>
+        </property>
+        <widget class="QWidget" name="blablaPage">
          <property name="sizePolicy">
-          <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+          <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
-         <property name="text">
-          <string notr="true">infoLabel</string>
-         </property>
-         <property name="textFormat">
-          <enum>Qt::RichText</enum>
-         </property>
-         <property name="wordWrap">
-          <bool>true</bool>
-         </property>
-         <property name="openExternalLinks">
-          <bool>true</bool>
-         </property>
-         <property name="textInteractionFlags">
-          <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse</set>
-         </property>
+         <layout class="QVBoxLayout" name="verticalLayout_2">
+          <property name="margin">
+           <number>0</number>
+          </property>
+          <item>
+           <widget class="QWidget" name="update" native="true">
+            <layout class="QHBoxLayout" name="updateLayout">
+             <item>
+              <widget class="QLabel" name="UpdateLabel">
+               <property name="sizePolicy">
+                <sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
+               <property name="styleSheet">
+                <string notr="true">margin-bottom: 8px;margin-top: 4px;</string>
+               </property>
+               <property name="text">
+                <string>Update</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QPushButton" name="checkUpdates">
+               <property name="sizePolicy">
+                <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
+               <property name="text">
+                <string>Update</string>
+               </property>
+               <property name="flat">
+                <bool>true</bool>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </widget>
+          </item>
+          <item>
+           <widget class="QLabel" name="MainBlabla">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="styleSheet">
+             <string notr="true">padding-right: 20px;</string>
+            </property>
+            <property name="text">
+             <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;VLC media player is a free and open source media player, encoder and streamer made by the volunteers of the &lt;a href=&quot;http://www.videolan.org/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0057ae;&quot;&gt;VideoLAN&lt;/span&gt;&lt;/a&gt; community.&lt;/p&gt;&lt;p&gt;VLC uses its internal codecs and works on essentially every popular platform and can read almost every files, CDs, DVDs, network streams, capture cards and other media formats!&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.videolan.org/contribute/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0057ae;&quot;&gt;Help and join us!&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+            </property>
+            <property name="alignment">
+             <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+            </property>
+            <property name="wordWrap">
+             <bool>true</bool>
+            </property>
+            <property name="openExternalLinks">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+         </layout>
         </widget>
-       </item>
-       <item row="0" column="0" rowspan="2">
-        <widget class="QLabel" name="iconVLC">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Maximum" vsizetype="Minimum">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
+        <widget class="QTextEdit" name="licensePage">
+         <property name="frameShadow">
+          <enum>QFrame::Plain</enum>
          </property>
-         <property name="text">
-          <string notr="true">iconVLC</string>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="tab_2">
-      <attribute name="title">
-       <string>Authors</string>
-      </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout">
-       <item>
-        <widget class="QTextEdit" name="authorsEdit">
          <property name="textInteractionFlags">
           <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
          </property>
         </widget>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="tab_3">
-      <attribute name="title">
-       <string>Thanks</string>
-      </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout_2">
-       <item>
-        <widget class="QLabel" name="label">
-         <property name="text">
-          <string>We would like to thank the whole VLC community, the testers, our users and the following people (and the missing ones...) for their collaboration to create the best free software.</string>
+        <widget class="QTextEdit" name="authorsPage">
+         <property name="frameShadow">
+          <enum>QFrame::Plain</enum>
          </property>
-         <property name="wordWrap">
-          <bool>true</bool>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QTextEdit" name="thanksEdit">
          <property name="textInteractionFlags">
-          <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
+          <set>Qt::NoTextInteraction</set>
          </property>
         </widget>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="tab_4">
-      <attribute name="title">
-       <string>Licence</string>
-      </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout_3">
-       <item>
-        <widget class="QTextEdit" name="licenseEdit">
-         <property name="font">
-          <font>
-           <family>Courier</family>
-          </font>
-         </property>
-         <property name="lineWrapMode">
-          <enum>QTextEdit::NoWrap</enum>
-         </property>
-         <property name="acceptRichText">
-          <bool>false</bool>
+        <widget class="QTextEdit" name="creditPage">
+         <property name="frameShadow">
+          <enum>QFrame::Plain</enum>
          </property>
          <property name="textInteractionFlags">
-          <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
+          <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse</set>
          </property>
         </widget>
-       </item>
-      </layout>
-     </widget>
+       </widget>
+      </item>
+      <item row="0" column="2">
+       <widget class="QLabel" name="title">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>0</width>
+          <height>40</height>
+         </size>
+        </property>
+        <property name="styleSheet">
+         <string notr="true">margin-top: 10px</string>
+        </property>
+        <property name="text">
+         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:26pt; color:#353535;&quot;&gt;VLC media player&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="2">
+       <widget class="QLabel" name="version">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="styleSheet">
+         <string notr="true">font: 75 12pt &quot;Sans Serif&quot;;
+margin-bottom: 6px;</string>
+        </property>
+        <property name="text">
+         <string/>
+        </property>
+       </widget>
+      </item>
+     </layout>
     </widget>
    </item>
-   <item row="1" column="0">
-    <widget class="QDialogButtonBox" name="closeButtonBox">
-     <property name="standardButtons">
-      <set>QDialogButtonBox::NoButton</set>
+   <item>
+    <widget class="QFrame" name="footer">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="minimumSize">
+      <size>
+       <width>0</width>
+       <height>60</height>
+      </size>
+     </property>
+     <property name="styleSheet">
+      <string notr="true">background-color: rgb(201, 201, 201);
+background-color: rgb(230, 230, 230);</string>
      </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_2">
+      <property name="margin">
+       <number>0</number>
+      </property>
+      <item>
+       <widget class="QToolButton" name="authorsButton">
+        <property name="styleSheet">
+         <string notr="true">padding: 10px</string>
+        </property>
+        <property name="text">
+         <string>Authors</string>
+        </property>
+        <property name="autoRaise">
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QToolButton" name="licenseButton">
+        <property name="styleSheet">
+         <string notr="true">padding: 10px</string>
+        </property>
+        <property name="text">
+         <string>License</string>
+        </property>
+        <property name="autoRaise">
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QToolButton" name="creditsButton">
+        <property name="styleSheet">
+         <string notr="true">padding: 10px;</string>
+        </property>
+        <property name="text">
+         <string>Credits</string>
+        </property>
+        <property name="autoRaise">
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
+     </layout>
     </widget>
    </item>
   </layout>
index 3fa973fa7e199aff0d4de1cfc3cc465ed584a8ac..2db73aa57dc42cde49f1d520c36d93e41600ec05 100644 (file)
@@ -1,5 +1,6 @@
 <RCC>
     <qresource prefix="/logo">
+        <file alias="vlc256.png">../../../share/icons/256x256/vlc.png</file>
         <file alias="vlc128.png">../../../share/icons/128x128/vlc.png</file>
         <file alias="vlc16.png">../../../share/icons/16x16/vlc.png</file>
         <file alias="vlc48.png">../../../share/icons/48x48/vlc.png</file>