Add contact panel
diff --git a/.gitignore b/.gitignore
index 5853b18..530be1d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,12 +1,8 @@
-.DS_Store
-*.app
-Makefile
-*.o
-ui_*
-moc_*
-*.pb.*
-qrc*
-gdb-target
-.waf*
-.lock*
+.waf-1*
+**/*.pyc
build/
+.lock*
+*.o
+*.DS_Store
+*~
+tmp/
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();
}
diff --git a/waf b/waf
index 911b4ab..79e5e69 100755
--- a/waf
+++ b/waf
Binary files differ
diff --git a/wscript b/wscript
index 3e754e5..e60e569 100644
--- a/wscript
+++ b/wscript
@@ -2,13 +2,15 @@
VERSION='0.1'
APPNAME='QT-Test'
+from waflib import Configure
+
def options(opt):
opt.load('compiler_c compiler_cxx boost protoc qt4')
def configure(conf):
conf.load("compiler_c compiler_cxx")
-# conf.add_supported_cxxflags (cxxflags = ['-O3', '-g'])
+ conf.add_supported_cxxflags (cxxflags = ['-O3', '-g'])
conf.load('protoc')
@@ -17,3 +19,42 @@
conf.load('boost')
conf.check_boost(lib='system random thread')
+
+ conf.write_config_header('config.h')
+
+
+def build (bld):
+ qt = bld (
+ target = "ChronoChat",
+ features = "qt4 cxx cxxprogram",
+ defines = "WAF",
+ source = bld.path.ant_glob(['src/*.cpp', 'src/*.ui']),
+ includes = ".",
+ use = "QTCORE QTGUI",
+ )
+
+
+@Configure.conf
+def add_supported_cxxflags(self, cxxflags):
+ """
+ Check which cxxflags are supported by compiler and add them to env.CXXFLAGS variable
+ """
+ self.start_msg('Checking allowed flags for c++ compiler')
+
+ supportedFlags = []
+ for flag in cxxflags:
+ if self.check_cxx (cxxflags=[flag], mandatory=False):
+ supportedFlags += [flag]
+
+ self.end_msg (' '.join (supportedFlags))
+ self.env.CXXFLAGS += supportedFlags
+
+from waflib.TaskGen import feature, before_method, after_method
+@feature('cxx')
+@after_method('process_source')
+@before_method('apply_incpaths')
+def add_includes_paths(self):
+ incs = set(self.to_list(getattr(self, 'includes', '')))
+ for x in self.compiled_tasks:
+ incs.add(x.inputs[0].parent.path_from(self.path))
+ self.includes = list(incs)