Add CMakeLists.txt
This commit switch compilation to cmake
We now properly set the App icon (.icns file)
diff --git a/.gitignore b/.gitignore
index d00fbd1..46f3585 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,7 +28,7 @@
*.app
# Qt-es
-
+*.user
/.qmake.cache
/.qmake.stash
*.pro.user
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..0317afc
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,70 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+
+IF(POLICY CMP0022)
+ CMAKE_POLICY(SET CMP0022 NEW)
+ENDIF(POLICY CMP0022)
+
+PROJECT(RingClient)
+
+ADD_DEFINITIONS("-std=c++0x")
+
+FIND_PACKAGE(Qt5Core REQUIRED)
+FIND_PACKAGE(Qt5Gui REQUIRED)
+FIND_PACKAGE(Qt5Widgets REQUIRED)
+FIND_PACKAGE(LibRingClient REQUIRED)
+
+# Instruct CMake to run moc automatically when needed.
+SET(CMAKE_AUTOMOC ON)
+
+INCLUDE_DIRECTORIES(SYSTEM ${Qt5Core_INCLUDE_DIRS})
+INCLUDE_DIRECTORIES(SYSTEM ${Qt5Gui_INCLUDE_DIRS})
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
+INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR})
+INCLUDE_DIRECTORIES(${LIB_RING_CLIENT_INCLUDE_DIR})
+
+MESSAGE("LibRingClient is here:" ${LIB_RING_CLIENT_INCLUDE_DIR})
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
+
+#Files to compile
+SET(ringclient_SRCS
+ main.cpp
+ mainwindow.cpp
+ mysearchbar.cpp)
+
+SET(ringclient_FORMS
+ mainwindow.ui)
+
+QT5_WRAP_UI(ringclient_FORMS_HEADERS ${ringclient_FORMS})
+
+SET(ringclient_HDRS
+ mainwindox.h
+ mysearchbar.h)
+
+MESSAGE("BINARY IS HERE:" ${LIB_RING_CLIENT_LIBRARY})
+
+
+# Icons
+
+# NOTE: Don't include the path in MACOSX_BUNDLE_ICON_FILE -- this is
+# the property added to Info.plist
+SET(MACOSX_BUNDLE_ICON_FILE appicon.icns)
+
+# And this part tells CMake where to find and install the file itself
+SET(myApp_ICON ${CMAKE_CURRENT_SOURCE_DIR}/data/appicon.icns)
+SET_SOURCE_FILES_PROPERTIES(${myApp_ICON} PROPERTIES
+ MACOSX_PACKAGE_LOCATION "Resources")
+
+ADD_EXECUTABLE(RingClient MACOSX_BUNDLE
+ ${ringclient_SRCS}
+ ${ringclient_HEADERS_MOC}
+ ${ringclient_FORMS_HEADERS}
+ ${myApp_ICON})
+
+
+TARGET_LINK_LIBRARIES( RingClient
+ ${LIB_RING_CLIENT_LIBRARY}
+ ${QT_QTCORE_LIBRARY}
+ ${Qt5Widgets_LIBRARIES}
+ ${QT_QTGUI_LIBRARY}
+)
+
diff --git a/Ring.pro b/Ring.pro
deleted file mode 100644
index 4224ef0..0000000
--- a/Ring.pro
+++ /dev/null
@@ -1,31 +0,0 @@
-#-------------------------------------------------
-#
-# Project created by QtCreator 2014-12-02T09:49:01
-#
-#-------------------------------------------------
-
-QT += core gui
-
-greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
-
-TARGET = Ring
-TEMPLATE = app
-
-CONFIG += c++11
-
-SOURCES += main.cpp\
- mainwindow.cpp \
- mysearchbar.cpp
-
-HEADERS += mainwindow.h \
- mysearchbar.h
-
-FORMS += mainwindow.ui
-
-macx: LIBS += -L$$PWD/build/ -lqtsflphone
-
-INCLUDEPATH += $$PWD/../sflphone/kde/src/lib
-DEPENDPATH += $$PWD/../sflphone/kde/src/lib
-
-RESOURCES += \
- data.qrc
diff --git a/data/appicon.icns b/data/appicon.icns
new file mode 100644
index 0000000..908f9d6
--- /dev/null
+++ b/data/appicon.icns
Binary files differ
diff --git a/mainwindow.cpp b/mainwindow.cpp
index 9909b34..b899ecc 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -82,9 +82,6 @@
QObject::connect(callModel_, SIGNAL(incomingCall(Call*)),
this, SLOT(incoming_call(Call*)));
-
- connect(&pollTimer_, SIGNAL(timeout()), this, SLOT(pollEvents()));
- pollTimer_.start(1000);
}
void MainWindow::showAnswerBar()
@@ -183,6 +180,7 @@
void MainWindow::on_call_button_clicked()
{
mainCall_ = CallModel::instance()->dialingCall();
+ qDebug() << "ICI" << ui->search_bar->text();
mainCall_->setDialNumber(ui->search_bar->text());
mainCall_->performAction(Call::Action::ACCEPT);
}
@@ -203,13 +201,6 @@
transformAnswerBar();
}
-void MainWindow::pollEvents()
-{
- qDebug() << "Poll Events?";
- AccountModel::currentAccount()->poll_events();
-}
-
-
void MainWindow::on_decline_button_clicked()
{
diff --git a/mainwindow.h b/mainwindow.h
index 4bdb9ee..46e67f1 100644
--- a/mainwindow.h
+++ b/mainwindow.h
@@ -47,7 +47,6 @@
void incoming_call(Call* call);
void on_call_button_clicked();
void on_hangup_button_clicked();
- void pollEvents();
void on_answer_button_clicked();
@@ -60,7 +59,6 @@
Call* mainCall_{nullptr};
Account* mainAccount_;
LegacyHistoryBackend* backend_;
- QTimer pollTimer_;
QPoint clickPos_{QPoint(0,0)};
};