added about dialog(s) - some modifications needed
authorpavelpa <pavelpa@localhost>
Wed, 13 Jan 2010 09:19:07 +0000 (09:19 +0000)
committerpavelpa <pavelpa@localhost>
Wed, 13 Jan 2010 09:19:07 +0000 (09:19 +0000)
    - About Qt: not scrollable
    - About app: modifications to display items in system font/colors needed

src/gui/about.ui [new file with mode: 0644]
src/gui/gui.pro
src/gui/mainwindow.cpp
src/gui/mainwindow.h
src/gui/mainwindow.ui

diff --git a/src/gui/about.ui b/src/gui/about.ui
new file mode 100644 (file)
index 0000000..2941aa8
--- /dev/null
@@ -0,0 +1,222 @@
+<ui version="4.0" >
+ <class>AboutDialog</class>
+ <widget class="QDialog" name="AboutDialog" >
+  <property name="windowModality" >
+   <enum>Qt::WindowModal</enum>
+  </property>
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>500</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="sizePolicy" >
+   <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="minimumSize" >
+   <size>
+    <width>77</width>
+    <height>77</height>
+   </size>
+  </property>
+  <property name="maximumSize" >
+   <size>
+    <width>500</width>
+    <height>300</height>
+   </size>
+  </property>
+  <property name="palette" >
+   <palette>
+    <active>
+     <colorrole role="Base" >
+      <brush brushstyle="SolidPattern" >
+       <color alpha="255" >
+        <red>239</red>
+        <green>235</green>
+        <blue>231</blue>
+       </color>
+      </brush>
+     </colorrole>
+     <colorrole role="AlternateBase" >
+      <brush brushstyle="SolidPattern" >
+       <color alpha="255" >
+        <red>239</red>
+        <green>235</green>
+        <blue>231</blue>
+       </color>
+      </brush>
+     </colorrole>
+    </active>
+    <inactive>
+     <colorrole role="Base" >
+      <brush brushstyle="SolidPattern" >
+       <color alpha="255" >
+        <red>239</red>
+        <green>235</green>
+        <blue>231</blue>
+       </color>
+      </brush>
+     </colorrole>
+     <colorrole role="AlternateBase" >
+      <brush brushstyle="SolidPattern" >
+       <color alpha="255" >
+        <red>239</red>
+        <green>235</green>
+        <blue>231</blue>
+       </color>
+      </brush>
+     </colorrole>
+    </inactive>
+    <disabled>
+     <colorrole role="Base" >
+      <brush brushstyle="SolidPattern" >
+       <color alpha="255" >
+        <red>255</red>
+        <green>255</green>
+        <blue>255</blue>
+       </color>
+      </brush>
+     </colorrole>
+     <colorrole role="AlternateBase" >
+      <brush brushstyle="SolidPattern" >
+       <color alpha="255" >
+        <red>239</red>
+        <green>235</green>
+        <blue>231</blue>
+       </color>
+      </brush>
+     </colorrole>
+    </disabled>
+   </palette>
+  </property>
+  <property name="windowTitle" >
+   <string>About application</string>
+  </property>
+  <property name="locale" >
+   <locale country="AnyCountry" language="C" />
+  </property>
+  <layout class="QGridLayout" name="gridLayout" >
+   <item row="0" column="0" >
+    <layout class="QHBoxLayout" name="horizontalLayout" >
+     <item>
+      <layout class="QVBoxLayout" name="verticalLayout" >
+       <item>
+        <widget class="QLabel" name="FosdemIcon" >
+         <property name="sizePolicy" >
+          <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="text" >
+          <string/>
+         </property>
+         <property name="pixmap" >
+          <pixmap resource="../icons.qrc" >:/icons/fosdem.png</pixmap>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="verticalSpacer" >
+         <property name="orientation" >
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0" >
+          <size>
+           <width>20</width>
+           <height>40</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <layout class="QVBoxLayout" name="verticalLayout_2" >
+       <item>
+        <widget class="QTextBrowser" name="textBrowser" >
+         <property name="enabled" >
+          <bool>true</bool>
+         </property>
+         <property name="autoFillBackground" >
+          <bool>true</bool>
+         </property>
+         <property name="locale" >
+          <locale country="AnyCountry" language="C" />
+         </property>
+         <property name="frameShape" >
+          <enum>QFrame::NoFrame</enum>
+         </property>
+         <property name="frameShadow" >
+          <enum>QFrame::Plain</enum>
+         </property>
+         <property name="readOnly" >
+          <bool>true</bool>
+         </property>
+         <property name="html" >
+          <string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
+p, li { white-space: pre-wrap; }
+&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600; color:#000000;">Qt FOSDEM/Maemo&lt;/span>&lt;/p>
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;">&lt;span style=" font-family:'Sans Serif'; font-size:9pt; color:#000000;">Version 1.0.0.&lt;/span>&lt;/p>
+&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;/p>
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;">The FOSDEM Maemo is an application making the conference schedule available offline. Supports searches on various items (speaker, speech topic, location, etc.). For Nokia N8x0 and N900 Internet Tablets.&lt;/p>
+&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;">&lt;/p>
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;">&lt;span style=" font-weight:600; color:#000000;">Developers:&lt;/span>&lt;/p>
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;">&lt;span style=" color:#000000;">Berendova Monika, Hanzes Matus, Komara Martin, Korinek Pavol,&lt;/span>&lt;/p>
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt; color:#000000;">Pavelka Pavol, Timko Marek, Uzak Matus&lt;/p>
+&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;">&lt;/p>
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;">&lt;span style=" color:#000000;">Copyright (C) Ixonos, 2010&lt;/span>&lt;/p>
+&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;">&lt;/p>
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;">&lt;span style=" font-size:7pt; color:#000000;">This program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR PARTICULAR PURPOSE.&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
+         </property>
+         <property name="overwriteMode" >
+          <bool>false</bool>
+         </property>
+         <property name="acceptRichText" >
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QDialogButtonBox" name="buttonOK" >
+         <property name="standardButtons" >
+          <set>QDialogButtonBox::Ok</set>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="../icons.qrc" />
+  <include location="../icons.qrc" />
+ </resources>
+ <connections>
+  <connection>
+   <sender>buttonOK</sender>
+   <signal>accepted()</signal>
+   <receiver>AboutDialog</receiver>
+   <slot>close()</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>292</x>
+     <y>272</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>249</x>
+     <y>149</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
index 1728bc9..26c5386 100644 (file)
@@ -15,7 +15,8 @@ TARGETDEPS += $$DESTDIR/liborm.a $$DESTDIR/libmodel.a $$DESTDIR/libsql.a
 # Please note that resources MUST be added to the app module
 # (which means they need to be added to the test module as well,
 # but I am sure you can live with that for the time being).
-FORMS += mainwindow.ui
+FORMS += mainwindow.ui \
+         about.ui
 SOURCES += mainwindow.cpp
 HEADERS += mainwindow.h
 
index c8ce6f5..5784d47 100644 (file)
@@ -9,12 +9,19 @@
 #include <eventmodel.h>
 #include <delegate.h>
 
+#include <QDialog>
+#include "ui_about.h"
 
 MainWindow::MainWindow(QWidget *parent)
     : QMainWindow(parent)
 {
     setupUi(this);
 
+    // connect Menu actions
+    connect(actionImportSchedule, SIGNAL(triggered()), SLOT(importSchedule()));
+    connect(actionAboutQt, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
+    connect(actionAboutApplication, SIGNAL(triggered()), SLOT(aboutApp()));
+
     // create "SQLITE" DB instance/connection
     // opens DB connection (needed for EventModel)
     mSqlEngine = new SqlEngine(this);
@@ -24,8 +31,6 @@ MainWindow::MainWindow(QWidget *parent)
     connect(mXmlParser, SIGNAL(progressStatus(int)), this, SLOT(showParsingProgress(int)));
     statusBar()->showMessage(tr("Ready"));
 
-    connect(actionImportSchedule, SIGNAL(triggered()), SLOT(importSchedule()));
-
     treeView->setHeaderHidden(true);
     treeView->setRootIsDecorated(false);
     treeView->setIndentation(0);
@@ -69,3 +74,11 @@ void MainWindow::showParsingProgress(int aStatus)
     statusBar()->showMessage(msg,1000);
 }
 
+void MainWindow::aboutApp()
+{
+    QDialog dialog(this);
+    Ui::AboutDialog ui;
+    ui.setupUi(&dialog);
+    dialog.exec();
+}
+
index 7ab90d9..94a04cf 100644 (file)
@@ -17,9 +17,11 @@ public:
 private slots:
     void importSchedule();
     void showParsingProgress(int aStatus);
+    void aboutApp();
 private:
     SqlEngine *mSqlEngine;
     ScheduleXmlParser *mXmlParser;
 };
 
 #endif // MAINWINDOW_H
+
index 412bd10..eca186c 100644 (file)
        <layout class="QGridLayout" name="gridLayout_2" >
         <item row="0" column="0" >
          <layout class="QVBoxLayout" name="verticalLayout" >
+          <item>
+           <layout class="QHBoxLayout" name="horizontalLayout_2" >
+            <item>
+             <widget class="QToolButton" name="buttonPrevDay" >
+              <property name="text" >
+               <string>&lt;|</string>
+              </property>
+              <property name="autoRaise" >
+               <bool>true</bool>
+              </property>
+              <property name="arrowType" >
+               <enum>Qt::LeftArrow</enum>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <spacer name="horizontalSpacer" >
+              <property name="orientation" >
+               <enum>Qt::Horizontal</enum>
+              </property>
+              <property name="sizeHint" stdset="0" >
+               <size>
+                <width>40</width>
+                <height>20</height>
+               </size>
+              </property>
+             </spacer>
+            </item>
+            <item>
+             <widget class="QLabel" name="label" >
+              <property name="text" >
+               <string>Selected Date Goes Here</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <spacer name="horizontalSpacer_2" >
+              <property name="orientation" >
+               <enum>Qt::Horizontal</enum>
+              </property>
+              <property name="sizeHint" stdset="0" >
+               <size>
+                <width>40</width>
+                <height>20</height>
+               </size>
+              </property>
+             </spacer>
+            </item>
+            <item>
+             <widget class="QToolButton" name="buttonNextDay" >
+              <property name="text" >
+               <string>|></string>
+              </property>
+              <property name="autoRaise" >
+               <bool>true</bool>
+              </property>
+              <property name="arrowType" >
+               <enum>Qt::RightArrow</enum>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
           <item>
            <widget class="TreeView" name="treeView" >
             <property name="maximumSize" >
     </property>
     <addaction name="actionImportSchedule" />
    </widget>
+   <widget class="QMenu" name="menuAbout" >
+    <property name="title" >
+     <string>Help</string>
+    </property>
+    <addaction name="actionAboutQt" />
+    <addaction name="actionAboutApplication" />
+   </widget>
    <addaction name="menuFile" />
+   <addaction name="menuAbout" />
   </widget>
   <widget class="QStatusBar" name="statusbar" />
   <action name="actionImportSchedule" >
     <string>Import Schedule</string>
    </property>
   </action>
+  <action name="actionAboutQt" >
+   <property name="text" >
+    <string>About Qt</string>
+   </property>
+  </action>
+  <action name="actionAboutApplication" >
+   <property name="text" >
+    <string>About application</string>
+   </property>
+  </action>
  </widget>
  <customwidgets>
   <customwidget>