Skip to content

Commit

Permalink
Merge pull request #4 from Emotyco/develop
Browse files Browse the repository at this point in the history
Version 0.2
  • Loading branch information
kdebiec authored Aug 10, 2017
2 parents 33ea141 + 4549ec7 commit d167459
Show file tree
Hide file tree
Showing 85 changed files with 4,801 additions and 1,035 deletions.
21 changes: 21 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
language: cpp

os: linux
dist: trusty
sudo: required
compiler: gcc

before_install:
- sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa
- sudo add-apt-repository --yes ppa:beineri/opt-qt58-trusty
- sudo apt-get -qq update

install:
- sudo apt-get -y install build-essential libgl1-mesa-dev
- sudo apt-get -y install libpulse-mainloop-glib0 libpulse0 libpulse-dev
- sudo apt-get -y install qt58base qt58graphicaleffects qt58quickcontrols qt58quickcontrols2 qt58svg qt58tools qt58multimedia

script:
- source /opt/qt58/bin/qt58-env.sh
- /opt/qt58/bin/qmake
- make
10 changes: 6 additions & 4 deletions Bridge/LoginWindow/loginwindow_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@

//Emoty-GUI
#include "loginwindow_main.h"
#include "../../Util/screensize.h"

#ifdef BORDERLESS_LOGIN
//Emoty-GUI
#include "borderlesswindow.h"
#include "../../util/screensize.h"
#endif
#ifndef BORDERLESS_LOGIN
//Qt
Expand All @@ -53,8 +53,10 @@ int loginwindow_main(int argc, char **argv)
QQuickView view;
view.setResizeMode(QQuickView::SizeRootObjectToView);

view.setMaximumSize(QSize(400, 470));
view.setMinimumSize(QSize(400, 470));
ScreenSize screenSize;

view.setMaximumSize(QSize(screenSize.width()/2, screenSize.height()/2));
view.setMinimumSize(QSize(screenSize.width()/2, screenSize.height()/2));

QObject::connect(&view, SIGNAL(closing(QQuickCloseEvent*)), &app, SLOT(quit()));

Expand Down Expand Up @@ -82,7 +84,7 @@ int loginwindow_main(int argc, char **argv)

// Create window
ScreenSize screenSize;
BorderlessWindow window(windowBackground, (screenSize.width()-400)/2, (screenSize.height()-470)/2, 400, 470);
BorderlessWindow window(windowBackground, screenSize.width()/4, screenSize.height()/4, screenSize.width()/2, screenSize.height()/2);
#endif

return app.exec();
Expand Down
29 changes: 29 additions & 0 deletions Bridge/MainWindow/mainwindowpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "notifier.h"
#include "soundnotifier.h"
#include "Util/runstatehelper.h"
#include "Bridge/Models/contactsmodel.h"

MainWindowPanel::MainWindowPanel(HWND hWnd) : QWinView(hWnd)
{
Expand All @@ -57,6 +58,7 @@ MainWindowPanel::MainWindowPanel(HWND hWnd) : QWinView(hWnd)
rsApi = new LibresapiLocalClient();
rsApi->openConnection(sockPath);

base64 = new Base64();
QQmlContext *ctxt = this->rootContext();
ctxt->setContextProperty("view", this);
ctxt->setContextProperty("qMainPanel", this);
Expand All @@ -67,10 +69,37 @@ MainWindowPanel::MainWindowPanel(HWND hWnd) : QWinView(hWnd)
ctxt->setContextProperty("soundNotifier", SoundNotifier::getInstance());
ctxt->setContextProperty("rsApi", rsApi);
ctxt->setContextProperty("runStateHelper", RunStateHelper::getInstance());
ctxt->setContextProperty("base64", base64);

ctxt->setContextProperty("gxsModel", ContactsModel::getInstance());

contactsModel = new ContactsSortModel();
contactsModel->setSourceModel(ContactsModel::getInstance());
ctxt->setContextProperty("contactsModel", contactsModel);

identitiesModel = new IdentitiesSortModel();
identitiesModel->setSourceModel(ContactsModel::getInstance());
ctxt->setContextProperty("identitiesModel", identitiesModel);

this->setSource(QUrl("qrc:/Borderless.qml"));
show();
}

MainWindowPanel::~MainWindowPanel()
{
if(base64 != NULL)
delete base64;
base64 = NULL;

if(contactsModel != NULL)
delete contactsModel;
contactsModel = NULL;

if(identitiesModel != NULL)
delete identitiesModel;
identitiesModel = NULL;
}

// Button events
void MainWindowPanel::pushButtonMinimizeClicked()
{
Expand Down
9 changes: 9 additions & 0 deletions Bridge/MainWindow/mainwindowpanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,18 @@
//Emoty-GUI
#include "Bridge/Windows/qwinview.h"
#include "libresapilocalclient.h"
#include "Util/base64.h"

#include "Bridge/Models/contactssortmodel.h"
#include "Bridge/Models/identitiessortmodel.h"

class MainWindowPanel : public QWinView
{
Q_OBJECT

public:
MainWindowPanel(HWND hWnd);
~MainWindowPanel();

public slots:
void pushButtonMinimizeClicked();
Expand All @@ -51,6 +56,10 @@ public slots:
private:
HWND windowHandle;
LibresapiLocalClient *rsApi;
Base64 *base64;

ContactsSortModel *contactsModel;
IdentitiesSortModel *identitiesModel;
};

#endif // MainWindowPanel_H
Loading

0 comments on commit d167459

Please sign in to comment.