From 40bedb896a2156533d00b0f991fb9ba0a0a77191 Mon Sep 17 00:00:00 2001 From: theonering Date: Sat, 20 Feb 2010 16:31:59 +0100 Subject: [PATCH] removed useless gui --- src/Gui/SnoreNotifyGui.pro | 17 -------- src/Gui/gmain.cpp | 11 ------ src/Gui/mainwindow.cpp | 75 ----------------------------------- src/Gui/mainwindow.h | 36 ----------------- src/Gui/mainwindow.ui | 61 ----------------------------- src/Gui/ui_mainwindow.h | 80 -------------------------------------- 6 files changed, 280 deletions(-) delete mode 100644 src/Gui/SnoreNotifyGui.pro delete mode 100644 src/Gui/gmain.cpp delete mode 100644 src/Gui/mainwindow.cpp delete mode 100644 src/Gui/mainwindow.h delete mode 100644 src/Gui/mainwindow.ui delete mode 100644 src/Gui/ui_mainwindow.h diff --git a/src/Gui/SnoreNotifyGui.pro b/src/Gui/SnoreNotifyGui.pro deleted file mode 100644 index 3f51be7..0000000 --- a/src/Gui/SnoreNotifyGui.pro +++ /dev/null @@ -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 diff --git a/src/Gui/gmain.cpp b/src/Gui/gmain.cpp deleted file mode 100644 index 5c9c636..0000000 --- a/src/Gui/gmain.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include "mainwindow.h" - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - DBusBinding::registerTypes(); - MainWindow w; - w.show(); - return a.exec(); -} diff --git a/src/Gui/mainwindow.cpp b/src/Gui/mainwindow.cpp deleted file mode 100644 index d2ffc97..0000000 --- a/src/Gui/mainwindow.cpp +++ /dev/null @@ -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 reply= DBusBinding::snoreInterface.call("getApplicationList"); - if(reply.isValid()) - applicationListChanged(reply); - else - qDebug()<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 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 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()<item(index.row(),index.column())->text(),!itemsList_alerts->item(index.row(),index.column())->isEnabled()); - - -} diff --git a/src/Gui/mainwindow.h b/src/Gui/mainwindow.h deleted file mode 100644 index d47c817..0000000 --- a/src/Gui/mainwindow.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include -#include "application.h" -#include "dbusbinding.h" -#include - -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 diff --git a/src/Gui/mainwindow.ui b/src/Gui/mainwindow.ui deleted file mode 100644 index 6a8a66c..0000000 --- a/src/Gui/mainwindow.ui +++ /dev/null @@ -1,61 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 600 - 400 - - - - Snore Notify - - - - - - 20 - 60 - 141 - 301 - - - - - - - 160 - 60 - 256 - 301 - - - - - - - - 0 - 0 - 600 - 20 - - - - - - TopToolBarArea - - - false - - - - - - - - diff --git a/src/Gui/ui_mainwindow.h b/src/Gui/ui_mainwindow.h deleted file mode 100644 index 1cffc88..0000000 --- a/src/Gui/ui_mainwindow.h +++ /dev/null @@ -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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -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