summaryrefslogtreecommitdiffstats
path: root/pica-client/mainwindow.cpp
diff options
context:
space:
mode:
authorme_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac>2013-04-01 18:03:18 +0000
committerme_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac>2013-04-01 18:03:18 +0000
commit5c2175f675751f63ffa47ffde156620cc6f77abd (patch)
treeaa1e02f2b79b43b7d48503d3fde4e2af477e239d /pica-client/mainwindow.cpp
parent7f34ed3d9f69619f1681d12f3dffeb3b3937326f (diff)
downloadpica-pica-5c2175f675751f63ffa47ffde156620cc6f77abd.tar.gz
pica-pica-5c2175f675751f63ffa47ffde156620cc6f77abd.zip
notifications in MainWindow, show-hide on button click
git-svn-id: svn://localhost/project_picapica/trunk@235 fb96df88-216d-11de-830c-f3023f12d8ac
Diffstat (limited to 'pica-client/mainwindow.cpp')
-rw-r--r--pica-client/mainwindow.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/pica-client/mainwindow.cpp b/pica-client/mainwindow.cpp
index 5bf44dd..2df04db 100644
--- a/pica-client/mainwindow.cpp
+++ b/pica-client/mainwindow.cpp
@@ -19,10 +19,16 @@ MainWindow::MainWindow(QWidget *parent) :
layout = new QVBoxLayout;
contact_list = new ContactListWidget;
status = new QComboBox;
+ notifications = new QListWidget();
+ bt_showhide_notifications = new QPushButton();
+ hide_notifications();
status->setMinimumHeight(36);
+ notifications->setMinimumHeight(48);
- layout->addWidget(contact_list);
+ layout->addWidget(notifications, 1, Qt::AlignTop);
+ layout->addWidget(bt_showhide_notifications, 0, Qt::AlignRight);
+ layout->addWidget(contact_list, 8);
layout->addWidget(status,0,Qt::AlignBottom);
centralWidget()->setLayout(layout);
@@ -40,6 +46,7 @@ MainWindow::MainWindow(QWidget *parent) :
connect(skynet, SIGNAL(BecameSelfAware()), this, SLOT(set_online()));
connect(skynet, SIGNAL(LostSelfAwareness()), this, SLOT(set_offline()));
connect(status, SIGNAL(currentIndexChanged(int)), this, SLOT(status_changed(int)));
+ connect(bt_showhide_notifications, SIGNAL(clicked()), this, SLOT(showhide_click()));
}
MainWindow::~MainWindow()
@@ -104,7 +111,27 @@ void MainWindow::createMenus()
}
+void MainWindow::show_notifications()
+{
+ notifications->show();
+ bt_showhide_notifications->setText(tr("Hide Notifications"));
+ status_notifications_hidden = false;
+}
+
+void MainWindow::hide_notifications()
+{
+ notifications->hide();
+ bt_showhide_notifications->setText(tr("Show Notifications"));
+ status_notifications_hidden = true;
+}
+void MainWindow::showhide_click()
+{
+ if (status_notifications_hidden)
+ show_notifications();
+ else
+ hide_notifications();
+}