fixing gui
authorMicke Nordin <mickewiki@gmail.com>
Sun, 10 Jan 2010 19:30:17 +0000 (20:30 +0100)
committerMicke Nordin <mickewiki@gmail.com>
Sun, 10 Jan 2010 19:30:17 +0000 (20:30 +0100)
12 files changed:
unlock/Makefile
unlock/main.cpp
unlock/main.o [new file with mode: 0644]
unlock/moc_unlock.cpp [new file with mode: 0644]
unlock/moc_unlock.o [new file with mode: 0644]
unlock/ui_unlock.h
unlock/unlock [new file with mode: 0755]
unlock/unlock.cpp
unlock/unlock.hpp
unlock/unlock.o [new file with mode: 0644]
unlock/unlock.pro
unlock/unlock.ui

index 4869147..a37d79b 100644 (file)
@@ -1,6 +1,6 @@
 #############################################################################
 # Makefile for building: unlock
-# Generated by qmake (2.01a) (Qt 4.6.0) on: sön jan 10 19:41:04 2010
+# Generated by qmake (2.01a) (Qt 4.6.0) on: sön jan 10 20:23:31 2010
 # Project:  unlock.pro
 # Template: app
 # Command: /usr/bin/qmake -unix -o Makefile unlock.pro
@@ -169,8 +169,7 @@ mocables: compiler_moc_header_make_all compiler_moc_source_make_all
 compiler_moc_header_make_all: moc_unlock.cpp
 compiler_moc_header_clean:
        -$(DEL_FILE) moc_unlock.cpp
-moc_unlock.cpp: ui_unlock.h \
-               unlock.hpp
+moc_unlock.cpp: unlock.hpp
        /usr/bin/moc $(DEFINES) $(INCPATH) unlock.hpp -o moc_unlock.cpp
 
 compiler_rcc_make_all:
@@ -196,11 +195,10 @@ compiler_clean: compiler_moc_header_clean compiler_uic_clean
 
 ####### Compile
 
-main.o: main.cpp unlock.hpp \
-               ui_unlock.h
+main.o: main.cpp unlock.hpp
        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
 
-unlock.o: unlock.cpp 
+unlock.o: unlock.cpp unlock.hpp
        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o unlock.o unlock.cpp
 
 moc_unlock.o: moc_unlock.cpp 
index 5e2f3c7..b45b401 100644 (file)
 
 
 #include <QApplication>
- #include "unlock.hpp"
+#include "unlock.hpp"
  
 int main(int argc, char *argv[])
 {
     QApplication app(argc, argv);
-    Unlock *dialog = new Unlock;
+    unlock *dialog = new unlock;
  
     dialog->show();
     return app.exec();
diff --git a/unlock/main.o b/unlock/main.o
new file mode 100644 (file)
index 0000000..fb6bd49
Binary files /dev/null and b/unlock/main.o differ
diff --git a/unlock/moc_unlock.cpp b/unlock/moc_unlock.cpp
new file mode 100644 (file)
index 0000000..30a6935
--- /dev/null
@@ -0,0 +1,79 @@
+/****************************************************************************
+** Meta object code from reading C++ file 'unlock.hpp'
+**
+** Created: Sun Jan 10 20:26:46 2010
+**      by: The Qt Meta Object Compiler version 62 (Qt 4.6.0)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#include "unlock.hpp"
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#error "The header file 'unlock.hpp' doesn't include <QObject>."
+#elif Q_MOC_OUTPUT_REVISION != 62
+#error "This file was generated using the moc from 4.6.0. It"
+#error "cannot be used with the include files from this version of Qt."
+#error "(The moc has changed too much.)"
+#endif
+
+QT_BEGIN_MOC_NAMESPACE
+static const uint qt_meta_data_unlock[] = {
+
+ // content:
+       4,       // revision
+       0,       // classname
+       0,    0, // classinfo
+       1,   14, // methods
+       0,    0, // properties
+       0,    0, // enums/sets
+       0,    0, // constructors
+       0,       // flags
+       0,       // signalCount
+
+ // slots: signature, parameters, type, tag, flags
+       8,    7,    7,    7, 0x08,
+
+       0        // eod
+};
+
+static const char qt_meta_stringdata_unlock[] = {
+    "unlock\0\0Close()\0"
+};
+
+const QMetaObject unlock::staticMetaObject = {
+    { &QMainWindow::staticMetaObject, qt_meta_stringdata_unlock,
+      qt_meta_data_unlock, 0 }
+};
+
+#ifdef Q_NO_DATA_RELOCATION
+const QMetaObject &unlock::getStaticMetaObject() { return staticMetaObject; }
+#endif //Q_NO_DATA_RELOCATION
+
+const QMetaObject *unlock::metaObject() const
+{
+    return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
+}
+
+void *unlock::qt_metacast(const char *_clname)
+{
+    if (!_clname) return 0;
+    if (!strcmp(_clname, qt_meta_stringdata_unlock))
+        return static_cast<void*>(const_cast< unlock*>(this));
+    return QMainWindow::qt_metacast(_clname);
+}
+
+int unlock::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
+{
+    _id = QMainWindow::qt_metacall(_c, _id, _a);
+    if (_id < 0)
+        return _id;
+    if (_c == QMetaObject::InvokeMetaMethod) {
+        switch (_id) {
+        case 0: Close(); break;
+        default: ;
+        }
+        _id -= 1;
+    }
+    return _id;
+}
+QT_END_MOC_NAMESPACE
diff --git a/unlock/moc_unlock.o b/unlock/moc_unlock.o
new file mode 100644 (file)
index 0000000..23022c9
Binary files /dev/null and b/unlock/moc_unlock.o differ
index a2785f4..82b30ae 100644 (file)
@@ -1,7 +1,7 @@
 /********************************************************************************
 ** Form generated from reading UI file 'unlock.ui'
 **
-** Created: Sun Jan 10 19:35:33 2010
+** Created: Sun Jan 10 20:23:33 2010
 **      by: Qt User Interface Compiler version 4.6.0
 **
 ** WARNING! All changes made in this file will be lost when recompiling UI file!
 #include <QtGui/QAction>
 #include <QtGui/QApplication>
 #include <QtGui/QButtonGroup>
-#include <QtGui/QDialog>
-#include <QtGui/QDialogButtonBox>
 #include <QtGui/QHeaderView>
 #include <QtGui/QLabel>
 #include <QtGui/QLineEdit>
+#include <QtGui/QMainWindow>
+#include <QtGui/QPushButton>
+#include <QtGui/QWidget>
 
 QT_BEGIN_NAMESPACE
 
-class Ui_Dialog
+class Ui_MainWindow
 {
 public:
-    QDialogButtonBox *buttonBox;
+    QWidget *centralwidget;
     QLineEdit *lineEdit;
+    QPushButton *pushButton;
     QLabel *label;
 
-    void setupUi(QDialog *Dialog)
+    void setupUi(QMainWindow *MainWindow)
     {
-        if (Dialog->objectName().isEmpty())
-            Dialog->setObjectName(QString::fromUtf8("Dialog"));
-        Dialog->resize(255, 77);
-        buttonBox = new QDialogButtonBox(Dialog);
-        buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
-        buttonBox->setGeometry(QRect(150, 10, 81, 301));
-        buttonBox->setOrientation(Qt::Vertical);
-        buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
-        lineEdit = new QLineEdit(Dialog);
+        if (MainWindow->objectName().isEmpty())
+            MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
+        MainWindow->resize(182, 66);
+        centralwidget = new QWidget(MainWindow);
+        centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
+        lineEdit = new QLineEdit(centralwidget);
         lineEdit->setObjectName(QString::fromUtf8("lineEdit"));
-        lineEdit->setGeometry(QRect(30, 40, 113, 26));
-        label = new QLabel(Dialog);
+        lineEdit->setGeometry(QRect(0, 30, 113, 26));
+        pushButton = new QPushButton(centralwidget);
+        pushButton->setObjectName(QString::fromUtf8("pushButton"));
+        pushButton->setGeometry(QRect(120, 30, 51, 28));
+        label = new QLabel(centralwidget);
         label->setObjectName(QString::fromUtf8("label"));
-        label->setGeometry(QRect(30, 10, 111, 20));
+        label->setGeometry(QRect(0, 10, 171, 18));
+        MainWindow->setCentralWidget(centralwidget);
 
-        retranslateUi(Dialog);
-        QObject::connect(buttonBox, SIGNAL(rejected()), Dialog, SLOT(reject()));
-        QObject::connect(buttonBox, SIGNAL(accepted()), Dialog, SLOT(accept()));
+        retranslateUi(MainWindow);
 
-        QMetaObject::connectSlotsByName(Dialog);
+        QMetaObject::connectSlotsByName(MainWindow);
     } // setupUi
 
-    void retranslateUi(QDialog *Dialog)
+    void retranslateUi(QMainWindow *MainWindow)
     {
-        Dialog->setWindowTitle(QApplication::translate("Dialog", "Dialog", 0, QApplication::UnicodeUTF8));
-#ifndef QT_NO_WHATSTHIS
-        lineEdit->setWhatsThis(QString());
-#endif // QT_NO_WHATSTHIS
-        label->setText(QApplication::translate("Dialog", "Enter password", 0, QApplication::UnicodeUTF8));
+        MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0, QApplication::UnicodeUTF8));
+        pushButton->setText(QApplication::translate("MainWindow", "Ok", 0, QApplication::UnicodeUTF8));
+        label->setText(QApplication::translate("MainWindow", "Enter master password", 0, QApplication::UnicodeUTF8));
     } // retranslateUi
 
 };
 
 namespace Ui {
-    class Dialog: public Ui_Dialog {};
+    class MainWindow: public Ui_MainWindow {};
 } // namespace Ui
 
 QT_END_NAMESPACE
diff --git a/unlock/unlock b/unlock/unlock
new file mode 100755 (executable)
index 0000000..4750475
Binary files /dev/null and b/unlock/unlock differ
index 56755f4..b918e15 100644 (file)
@@ -4,7 +4,7 @@
 //      
 //      This program is free software; you can redistribute it and/or modify
 //      it under the terms of the GNU General Public License as published by
-//      the Free Software Foundation; either version 3 of the License, or
+//      the Free Software Foundation; either version 2 of the License, or
 //      (at your option) any later version.
 //      
 //      This program is distributed in the hope that it will be useful,
 //      MA 02110-1301, USA.
 
 
-#include <QtGui> 
-#include "unlock.h"
-// if we include <QtGui> there is no need to include every class used: <QString>, <QFileDialog>,...
-Unlock::Unlock(QWidget *parent) {
-    setupUi(this); // this sets up GUI
-    // signals/slots mechanism in action
-    connect( pushButton_browse, SIGNAL( clicked() ), this, SLOT( accepted() ) ); 
-    connect( pushButton_do, SIGNAL( clicked() ), this, SLOT( rejected() ) ); 
-}
-void Unlock::accepted() {
-//
+#include "unlock.hpp"
+
+unlock::unlock(QWidget *parent) : QMainWindow(parent)
+{
+       ui.setupUi( this );
+       connect( ui.pushButton, SIGNAL(clicked()), this, SLOT(Close()));
 }
-void Unlock::rejected() {
- //
+
+void unlock::Close()
+{
+// can also add any extra closedown code here before we actually do close the GUI
+
+
+// now close for real
+       close();
 }
index 5f72a96..ca154a2 100644 (file)
 //      MA 02110-1301, USA.
 
 
-#ifndef _unlock_h_included_
-#define _unlock_h_included_
+#include <QMainWindow>
+#include <QWidget>
 #include "ui_unlock.h"
-class Unlock : public QWidget, private Ui::QDialog {
-    Q_OBJECT
-public:
-    Unlock(QWidget *parent = 0);
-public slots:
-    void accepted();
-    void rejected();
+class unlock : public QMainWindow
+{
+       Q_OBJECT
+
+       public:
+               unlock(QWidget *parent = 0);
+       private:
+               Ui::MainWindow ui;
+       private slots:
+               void Close();
 };
-#endif
diff --git a/unlock/unlock.o b/unlock/unlock.o
new file mode 100644 (file)
index 0000000..bae5591
Binary files /dev/null and b/unlock/unlock.o differ
index 4f292f2..acd2839 100644 (file)
@@ -1,5 +1,5 @@
 ######################################################################
-# Automatically generated by qmake (2.01a) sön jan 10 19:35:11 2010
+# Automatically generated by qmake (2.01a) sön jan 10 20:13:10 2010
 ######################################################################
 
 TEMPLATE = app
index f32f857..7b513b1 100644 (file)
@@ -1,94 +1,57 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
- <class>Dialog</class>
- <widget class="QDialog" name="Dialog">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>255</width>
-    <height>77</height>
+    <width>182</width>
+    <height>66</height>
    </rect>
   </property>
   <property name="windowTitle">
-   <string>Dialog</string>
+   <string>MainWindow</string>
   </property>
-  <widget class="QDialogButtonBox" name="buttonBox">
-   <property name="geometry">
-    <rect>
-     <x>150</x>
-     <y>10</y>
-     <width>81</width>
-     <height>301</height>
-    </rect>
-   </property>
-   <property name="orientation">
-    <enum>Qt::Vertical</enum>
-   </property>
-   <property name="standardButtons">
-    <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
-   </property>
-  </widget>
-  <widget class="QLineEdit" name="lineEdit">
-   <property name="geometry">
-    <rect>
-     <x>30</x>
-     <y>40</y>
-     <width>113</width>
-     <height>26</height>
-    </rect>
-   </property>
-   <property name="whatsThis">
-    <string/>
-   </property>
-  </widget>
-  <widget class="QLabel" name="label">
-   <property name="geometry">
-    <rect>
-     <x>30</x>
-     <y>10</y>
-     <width>111</width>
-     <height>20</height>
-    </rect>
-   </property>
-   <property name="text">
-    <string>Enter password</string>
-   </property>
+  <widget class="QWidget" name="centralwidget">
+   <widget class="QLineEdit" name="lineEdit">
+    <property name="geometry">
+     <rect>
+      <x>0</x>
+      <y>30</y>
+      <width>113</width>
+      <height>26</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QPushButton" name="pushButton">
+    <property name="geometry">
+     <rect>
+      <x>120</x>
+      <y>30</y>
+      <width>51</width>
+      <height>28</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Ok</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label">
+    <property name="geometry">
+     <rect>
+      <x>0</x>
+      <y>10</y>
+      <width>171</width>
+      <height>18</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Enter master password</string>
+    </property>
+   </widget>
   </widget>
  </widget>
  <resources/>
- <connections>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>rejected()</signal>
-   <receiver>Dialog</receiver>
-   <slot>reject()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>316</x>
-     <y>260</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>286</x>
-     <y>274</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>accepted()</signal>
-   <receiver>Dialog</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>248</x>
-     <y>254</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>157</x>
-     <y>274</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
+ <connections/>
 </ui>