mirror of
https://github.com/status-im/snorenotify.git
synced 2025-01-09 16:15:45 +00:00
removed useless gui
This commit is contained in:
parent
d5d1290397
commit
40bedb896a
@ -1,17 +0,0 @@
|
||||
# -------------------------------------------------
|
||||
# Project created by QtCreator 2009-11-24T23:39:55
|
||||
# -------------------------------------------------
|
||||
QT += dbus
|
||||
QT += gui
|
||||
QT += network
|
||||
TARGET = SnoreNotifyGui
|
||||
TEMPLATE = app
|
||||
INCLUDEPATH += ../. ./
|
||||
HEADERS += mainwindow.h \
|
||||
../dbusbinding.h \
|
||||
../application.h
|
||||
FORMS += mainwindow.ui
|
||||
SOURCES += ../dbusbinding.cpp \
|
||||
../application.cpp \
|
||||
gmain.cpp\
|
||||
mainwindow.cpp
|
@ -1,11 +0,0 @@
|
||||
#include <QtGui/QApplication>
|
||||
#include "mainwindow.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
DBusBinding::registerTypes();
|
||||
MainWindow w;
|
||||
w.show();
|
||||
return a.exec();
|
||||
}
|
@ -1,75 +0,0 @@
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent)
|
||||
: QMainWindow(parent), ui(new Ui::MainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
itemsList_applications=new QStandardItemModel(this);
|
||||
itemsList_alerts=new QStandardItemModel(this);
|
||||
ui->listView_applicationList->setModel(itemsList_applications);
|
||||
ui->listView_AlertList->setModel(itemsList_alerts);
|
||||
|
||||
QDBusReply<ApplicationsList> reply= DBusBinding::snoreInterface.call("getApplicationList");
|
||||
if(reply.isValid())
|
||||
applicationListChanged(reply);
|
||||
else
|
||||
qDebug()<<reply.error();
|
||||
DBusBinding::snoreInterface.connection().connect(DBusBinding::snoreInterface.service(),DBusBinding::snoreInterface.path(),DBusBinding::snoreInterface.interface(),"applicationListChanged",this,SLOT(applicationListChanged(ApplicationsList)));
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void MainWindow::applicationListChanged(const ApplicationsList &apls){
|
||||
itemsList_applications->setHorizontalHeaderItem(0,new QStandardItem("Registred Applications"));
|
||||
applicationList=apls;
|
||||
itemsList_applications->clear();
|
||||
QStandardItem *item;
|
||||
foreach(const QString &s,applicationList.keys()){
|
||||
item=new QStandardItem(s);
|
||||
item->setEditable(false);
|
||||
itemsList_applications->appendRow(item);
|
||||
}
|
||||
itemsList_alerts->clear();
|
||||
if(!currentSelectedApplication.isEmpty()&&applicationList.contains(currentSelectedApplication)){
|
||||
|
||||
foreach(QSharedPointer<Alert> al,applicationList.value(currentSelectedApplication)->alerts.values()){
|
||||
item=new QStandardItem(al->name);
|
||||
item->setEnabled(al->active);
|
||||
item->setEditable(false);
|
||||
itemsList_alerts->appendRow(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_listView_applicationList_clicked(QModelIndex index)
|
||||
{
|
||||
currentSelectedApplication=itemsList_applications->item(index.row(),index.column())->text();
|
||||
itemsList_alerts->setHorizontalHeaderItem(0,new QStandardItem("Alerts"));
|
||||
itemsList_alerts->setHorizontalHeaderItem(1,new QStandardItem("Active"));
|
||||
itemsList_alerts->clear();
|
||||
QStandardItem *item;
|
||||
foreach(QSharedPointer<Alert> al,applicationList.value(currentSelectedApplication)->alerts.values()){
|
||||
item=new QStandardItem(al->name);
|
||||
item->setEnabled(al->active);
|
||||
itemsList_alerts->appendRow(item);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::on_listView_AlertList_clicked(QModelIndex index)
|
||||
{
|
||||
qDebug()<<DBusBinding::snoreInterface.call(QDBus::AutoDetect,"setAlertActive",currentSelectedApplication,itemsList_alerts->item(index.row(),index.column())->text(),!itemsList_alerts->item(index.row(),index.column())->isEnabled());
|
||||
|
||||
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <QtGui/QMainWindow>
|
||||
#include "application.h"
|
||||
#include "dbusbinding.h"
|
||||
#include <QStandardItemModel>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class MainWindow;
|
||||
}
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MainWindow(QWidget *parent = 0);
|
||||
~MainWindow();
|
||||
ApplicationsList applicationList;
|
||||
QStandardItemModel* itemsList_applications;
|
||||
QStandardItemModel* itemsList_alerts;
|
||||
public slots:
|
||||
void applicationListChanged(const ApplicationsList &apls);
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
QString currentSelectedApplication;
|
||||
|
||||
private slots:
|
||||
void on_listView_AlertList_clicked(QModelIndex index);
|
||||
void on_listView_applicationList_clicked(QModelIndex index);
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
@ -1,61 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>600</width>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Snore Notify</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralWidget">
|
||||
<widget class="QListView" name="listView_applicationList">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>60</y>
|
||||
<width>141</width>
|
||||
<height>301</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QListView" name="listView_AlertList">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>160</x>
|
||||
<y>60</y>
|
||||
<width>256</width>
|
||||
<height>301</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menuBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>600</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="mainToolBar">
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusBar"/>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,80 +0,0 @@
|
||||
/********************************************************************************
|
||||
** Form generated from reading UI file 'mainwindow.ui'
|
||||
**
|
||||
** Created: Tue 29. Dec 01:35:26 2009
|
||||
** by: Qt User Interface Compiler version 4.6.0
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
********************************************************************************/
|
||||
|
||||
#ifndef UI_MAINWINDOW_H
|
||||
#define UI_MAINWINDOW_H
|
||||
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QButtonGroup>
|
||||
#include <QtGui/QHeaderView>
|
||||
#include <QtGui/QListView>
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QMenuBar>
|
||||
#include <QtGui/QStatusBar>
|
||||
#include <QtGui/QToolBar>
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Ui_MainWindow
|
||||
{
|
||||
public:
|
||||
QWidget *centralWidget;
|
||||
QListView *listView_applicationList;
|
||||
QListView *listView_AlertList;
|
||||
QMenuBar *menuBar;
|
||||
QToolBar *mainToolBar;
|
||||
QStatusBar *statusBar;
|
||||
|
||||
void setupUi(QMainWindow *MainWindow)
|
||||
{
|
||||
if (MainWindow->objectName().isEmpty())
|
||||
MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
|
||||
MainWindow->resize(600, 400);
|
||||
centralWidget = new QWidget(MainWindow);
|
||||
centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
|
||||
listView_applicationList = new QListView(centralWidget);
|
||||
listView_applicationList->setObjectName(QString::fromUtf8("listView_applicationList"));
|
||||
listView_applicationList->setGeometry(QRect(20, 60, 141, 301));
|
||||
listView_AlertList = new QListView(centralWidget);
|
||||
listView_AlertList->setObjectName(QString::fromUtf8("listView_AlertList"));
|
||||
listView_AlertList->setGeometry(QRect(160, 60, 256, 301));
|
||||
MainWindow->setCentralWidget(centralWidget);
|
||||
menuBar = new QMenuBar(MainWindow);
|
||||
menuBar->setObjectName(QString::fromUtf8("menuBar"));
|
||||
menuBar->setGeometry(QRect(0, 0, 600, 20));
|
||||
MainWindow->setMenuBar(menuBar);
|
||||
mainToolBar = new QToolBar(MainWindow);
|
||||
mainToolBar->setObjectName(QString::fromUtf8("mainToolBar"));
|
||||
MainWindow->addToolBar(Qt::TopToolBarArea, mainToolBar);
|
||||
statusBar = new QStatusBar(MainWindow);
|
||||
statusBar->setObjectName(QString::fromUtf8("statusBar"));
|
||||
MainWindow->setStatusBar(statusBar);
|
||||
|
||||
retranslateUi(MainWindow);
|
||||
|
||||
QMetaObject::connectSlotsByName(MainWindow);
|
||||
} // setupUi
|
||||
|
||||
void retranslateUi(QMainWindow *MainWindow)
|
||||
{
|
||||
MainWindow->setWindowTitle(QApplication::translate("MainWindow", "Snore Notify", 0, QApplication::UnicodeUTF8));
|
||||
} // retranslateUi
|
||||
|
||||
};
|
||||
|
||||
namespace Ui {
|
||||
class MainWindow: public Ui_MainWindow {};
|
||||
} // namespace Ui
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // UI_MAINWINDOW_H
|
Loading…
x
Reference in New Issue
Block a user