Add contact panel
diff --git a/src/contactpanel.cpp b/src/contactpanel.cpp
new file mode 100644
index 0000000..17d019f
--- /dev/null
+++ b/src/contactpanel.cpp
@@ -0,0 +1,30 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2013, Regents of the University of California
+ * Yingdi Yu
+ *
+ * BSD license, See the LICENSE file for more information
+ *
+ * Author: Yingdi Yu <yingdi@cs.ucla.edu>
+ */
+
+#include "contactpanel.h"
+#include "ui_contactpanel.h"
+
+ContactPanel::ContactPanel(QWidget *parent) :
+ QDialog(parent),
+ ui(new Ui::ContactPanel)
+{
+ ui->setupUi(this);
+}
+
+ContactPanel::~ContactPanel()
+{
+ delete ui;
+}
+
+
+#if WAF
+#include "contactpanel.moc"
+#include "contactpanel.cpp.moc"
+#endif
diff --git a/src/contactpanel.h b/src/contactpanel.h
new file mode 100644
index 0000000..f017d6d
--- /dev/null
+++ b/src/contactpanel.h
@@ -0,0 +1,32 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2013, Regents of the University of California
+ * Yingdi Yu
+ *
+ * BSD license, See the LICENSE file for more information
+ *
+ * Author: Yingdi Yu <yingdi@cs.ucla.edu>
+ */
+
+#ifndef CONTACTPANEL_H
+#define CONTACTPANEL_H
+
+#include <QDialog>
+
+namespace Ui {
+class ContactPanel;
+}
+
+class ContactPanel : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit ContactPanel(QWidget *parent = 0);
+ ~ContactPanel();
+
+private:
+ Ui::ContactPanel *ui;
+};
+
+#endif // CONTACTPANEL_H
diff --git a/src/contactpanel.ui b/src/contactpanel.ui
new file mode 100644
index 0000000..ec4ba9f
--- /dev/null
+++ b/src/contactpanel.ui
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ContactPanel</class>
+ <widget class="QDialog" name="ContactPanel">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>450</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Dialog</string>
+ </property>
+ <widget class="QWidget" name="">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>10</y>
+ <width>581</width>
+ <height>431</height>
+ </rect>
+ </property>
+ <layout class="QHBoxLayout" name="ContactPanelLayout" stretch="3,7">
+ <property name="spacing">
+ <number>10</number>
+ </property>
+ <item>
+ <widget class="QListWidget" name="ContactList"/>
+ </item>
+ <item>
+ <widget class="QTabWidget" name="ContactInfo">
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="General">
+ <attribute name="title">
+ <string>General</string>
+ </attribute>
+ <widget class="QGraphicsView" name="Avatar">
+ <property name="geometry">
+ <rect>
+ <x>130</x>
+ <y>10</y>
+ <width>128</width>
+ <height>128</height>
+ </rect>
+ </property>
+ </widget>
+ <widget class="QWidget" name="">
+ <property name="geometry">
+ <rect>
+ <x>30</x>
+ <y>160</y>
+ <width>331</width>
+ <height>124</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout" stretch="35,100">
+ <property name="spacing">
+ <number>-1</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Name space</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEdit">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2" stretch="35,100">
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Name</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEdit_2">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3" stretch="35,100">
+ <item>
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Institution </string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEdit_3">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <widget class="QWidget" name="TrustLevel">
+ <attribute name="title">
+ <string>Trust Level</string>
+ </attribute>
+ </widget>
+ <widget class="QWidget" name="Endorse">
+ <attribute name="title">
+ <string>Endorse</string>
+ </attribute>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/main.cpp b/src/main.cpp
index 6c2ff22..83212d2 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,31 +1,34 @@
-#include<QApplication>
-#include "chatdialog.h"
-#include <QMessageBox>
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2013, Regents of the University of California
+ * Yingdi Yu
+ *
+ * BSD license, See the LICENSE file for more information
+ *
+ * Author: Yingdi Yu <yingdi@cs.ucla.edu>
+ */
+
+#include <QApplication>
+#include <QSystemTrayIcon>
+
+#include "chronochat.h"
+#include "contactpanel.h"
int main(int argc, char *argv[])
{
- // Q_INIT_RESOURCE(demo);
QApplication app(argc, argv);
- if (!QSystemTrayIcon::isSystemTrayAvailable()) {
- QMessageBox::critical(0, QObject::tr("Systray"),
- QObject::tr("I couldn't detect any system tray "
- "on this system."));
- return 1;
- }
- QApplication::setQuitOnLastWindowClosed (false);
-#ifdef __APPLE__
- app.setWindowIcon(QIcon(":/demo.icns"));
-#else
- app.setWindowIcon(QIcon(":/images/icon_large.png"));
-#endif
+// app.setWindowIcon(QIcon("/Users/yuyingdi/Develop/QT/demo.icns"));
+// // #else
+// // app.setWindowIcon(QIcon("/Users/yuyingdi/Develop/QT/images/icon_large.png"));
+// // #endif
- ChatDialog dialog;
+ ContactPanel contactPanel;
- dialog.show ();
- dialog.activateWindow ();
- dialog.raise ();
-
+ contactPanel.show ();
+ contactPanel.activateWindow ();
+ contactPanel.raise ();
+
return app.exec();
}