2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Henri Lampela - henri.lampela@ixonos.com
6 Kaj Wallin - kaj.wallin@ixonos.com
7 Jussi Laitinen jussi.laitinen@ixonos.com
8 Sami Rämö - sami.ramo@ixonos.com
9 Ville Tiensuu - ville.tiensuu@ixonos.com
11 Situare is free software; you can redistribute it and/or
12 modify it under the terms of the GNU General Public License
13 version 2 as published by the Free Software Foundation.
15 Situare is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with Situare; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 #include <QtAlgorithms>
31 #include "facebookservice/facebookauthentication.h"
32 #include "friendlistpanel.h"
33 #include "logindialog.h"
34 #include "map/mapview.h"
35 #include "settingsdialog.h"
36 #include "userinfopanel.h"
37 #include "zoombuttonpanel.h"
39 #include "mainwindow.h"
41 // These MUST BE HERE, compiling for Maemo fails if moved
43 #include <QtMaemo5/QMaemo5InformationBox>
44 #include <QtGui/QX11Info>
45 #include <X11/Xatom.h>
47 #endif // Q_WS_MAEMO_5
49 // values for setting screen size in desktop matching N900 screen size
50 const int N900_APP_WIDTH = 800;
51 const int N900_APP_HEIGHT = 449;
53 MainWindow::MainWindow(QWidget *parent)
54 : QMainWindow(parent),
55 m_drawOwnLocationCrosshair(false),
59 m_ownLocationCrosshair(0),
62 m_fullScreenButton(0),
66 qDebug() << __PRETTY_FUNCTION__;
71 QHBoxLayout *layout = new QHBoxLayout;
72 layout->addWidget(m_mapView);
74 setCentralWidget(new QWidget());
75 centralWidget()->setLayout(layout);
77 buildFriendListPanel();
80 m_settingsDialog = new SettingsDialog(this);
81 m_settingsDialog->hide();
82 connect(m_settingsDialog, SIGNAL(enableAutomaticLocationUpdate(bool,int)),
83 this, SIGNAL(enableAutomaticLocationUpdate(bool,int)));
86 setWindowTitle(tr("Situare"));
88 // set stacking order of widgets
89 m_zoomButtonPanel->stackUnder(m_userPanel);
90 if(m_fullScreenButton) {
91 m_fullScreenButton->stackUnder(m_zoomButtonPanel);
92 m_osmLicense->stackUnder(m_fullScreenButton);
94 m_osmLicense->stackUnder(m_zoomButtonPanel);
95 m_ownLocationCrosshair->stackUnder(m_osmLicense);
96 m_mapView->stackUnder(m_ownLocationCrosshair);
98 this->toggleProgressIndicator(true);
102 // set screen size in desktop matching N900 screen size
103 resize(N900_APP_WIDTH, N900_APP_HEIGHT);
106 MainWindow::~MainWindow()
108 qDebug() << __PRETTY_FUNCTION__;
115 qDeleteAll(m_queue.begin(), m_queue.end());
118 qDeleteAll(m_error_queue.begin(), m_error_queue.end());
119 m_error_queue.clear();
122 void MainWindow::buildFullScreenButton()
124 qDebug() << __PRETTY_FUNCTION__;
126 m_fullScreenButton = new QToolButton(this);
127 m_fullScreenButton->setIcon(QIcon::fromTheme(QLatin1String("general_fullsize")));
128 m_fullScreenButton->setFixedSize(m_fullScreenButton->sizeHint());
129 connect(m_fullScreenButton, SIGNAL(clicked()),
130 this, SLOT(toggleFullScreen()));
131 #endif // Q_WS_MAEMO_5
135 void MainWindow::buildFriendListPanel()
137 qDebug() << __PRETTY_FUNCTION__;
139 m_friendsListPanel = new FriendListPanel(this);
140 m_friendsListPanelSidebar = new PanelSideBar(this, RIGHT);
142 m_friendsListPanel->stackUnder(m_friendsListPanelSidebar);
144 connect(this, SIGNAL(friendsLocationsReady(QList<User*>&)),
145 m_friendsListPanel, SLOT(friendInfoReceived(QList<User*>&)));
147 connect(m_friendsListPanel, SIGNAL(findFriend(QPointF)),
148 this, SIGNAL(findFriend(QPointF)));
150 connect(m_mapView, SIGNAL(viewResized(QSize)),
151 m_friendsListPanel, SLOT(screenResized(QSize)));
153 connect(this, SIGNAL(locationItemClicked(QList<QString>)),
154 m_friendsListPanel, SLOT(showFriendsInList(QList<QString>)));
156 connect(m_mapView, SIGNAL(viewResizedNewSize(int, int)),
157 m_friendsListPanelSidebar, SLOT(reDrawSidebar(int, int)));
160 void MainWindow::buildInformationBox(const QString &message, bool modal)
162 qDebug() << __PRETTY_FUNCTION__;
165 QMaemo5InformationBox *msgBox = new QMaemo5InformationBox(this);
166 QLabel *label = new QLabel(msgBox);
167 label->setAlignment(Qt::AlignCenter);
168 label->setText(message);
169 msgBox->setWidget(label);
172 msgBox->setTimeout(QMaemo5InformationBox::NoTimeout);
174 msgBox->setTimeout(QMaemo5InformationBox::DefaultTimeout);
177 QMessageBox *msgBox = new QMessageBox(this);
178 msgBox->button(QMessageBox::Ok);
179 msgBox->setText(message);
180 msgBox->setModal(modal);
186 void MainWindow::buildManualLocationCrosshair()
188 qDebug() << __PRETTY_FUNCTION__;
190 m_ownLocationCrosshair = new QLabel(this);
191 QPixmap crosshairImage(":/res/images/sight.png");
192 m_ownLocationCrosshair->setPixmap(crosshairImage);
193 m_ownLocationCrosshair->setFixedSize(crosshairImage.size());
194 m_ownLocationCrosshair->hide();
195 m_ownLocationCrosshair->setAttribute(Qt::WA_TransparentForMouseEvents, true);
197 connect(m_mapView, SIGNAL(viewResizedNewSize(int, int)),
198 this, SLOT(drawOwnLocationCrosshair(int, int)));
201 void MainWindow::buildMap()
203 qDebug() << __PRETTY_FUNCTION__;
205 m_mapView = new MapView(this);
207 buildZoomButtonPanel();
209 buildManualLocationCrosshair();
210 buildFullScreenButton();
212 connect(m_mapView, SIGNAL(viewScrolled(QPoint)),
213 this, SIGNAL(mapViewScrolled(QPoint)));
215 connect(this, SIGNAL(centerToSceneCoordinates(QPoint)),
216 m_mapView, SLOT(centerToSceneCoordinates(QPoint)));
218 connect(m_mapView, SIGNAL(viewResized(QSize)),
219 this, SIGNAL(mapViewResized(QSize)));
221 connect(m_mapView, SIGNAL(viewResized(QSize)),
222 this, SLOT(drawFullScreenButton(QSize)));
224 connect(m_mapView, SIGNAL(viewResizedNewSize(int, int)),
225 this, SLOT(setViewPortSize(int, int)));
227 connect(this, SIGNAL(zoomLevelChanged(int)),
228 m_mapView, SLOT(setZoomLevel(int)));
230 connect(m_mapView, SIGNAL(viewZoomFinished()),
231 this, SIGNAL(viewZoomFinished()));
234 void MainWindow::buildOsmLicense()
236 qDebug() << __PRETTY_FUNCTION__;
238 m_osmLicense = new QLabel(this);
239 m_osmLicense->setAttribute(Qt::WA_TranslucentBackground, true);
240 m_osmLicense->setAttribute(Qt::WA_TransparentForMouseEvents, true);
241 m_osmLicense->setText("<font color='black'>" + OSM_LICENSE + "</font>");
242 m_osmLicense->setFont(QFont("Nokia Sans", 9));
243 m_osmLicense->resize(m_osmLicense->fontMetrics().width(OSM_LICENSE),
244 m_osmLicense->fontMetrics().height());
246 connect(m_mapView, SIGNAL(viewResized(QSize)),
247 this, SLOT(drawOsmLicense(QSize)));
250 void MainWindow::buildUserInfoPanel()
252 qDebug() << __PRETTY_FUNCTION__;
254 m_userPanel = new UserInfoPanel(this);
255 m_userPanelSidebar = new PanelSideBar(this, LEFT);
257 m_userPanelSidebar->stackUnder(m_friendsListPanel);
258 m_userPanel->stackUnder(m_userPanelSidebar);
260 connect(m_userPanel, SIGNAL(findUser(QPointF)),
261 this, SIGNAL(findUser(QPointF)));
263 connect(this, SIGNAL(userLocationReady(User*)),
264 m_userPanel, SLOT(userDataReceived(User*)));
266 connect(m_userPanel, SIGNAL(requestReverseGeo()),
267 this, SIGNAL(requestReverseGeo()));
269 connect(this, SIGNAL(reverseGeoReady(QString)),
270 m_userPanel, SIGNAL(reverseGeoReady(QString)));
272 connect(m_userPanel, SIGNAL(statusUpdate(QString,bool)),
273 this, SIGNAL(statusUpdate(QString,bool)));
275 connect(m_userPanel, SIGNAL(refreshUserData()),
276 this, SIGNAL(refreshUserData()));
278 connect(m_mapView, SIGNAL(viewResized(QSize)),
279 m_userPanel, SLOT(screenResized(QSize)));
282 void MainWindow::buildWebView()
284 qDebug() << __PRETTY_FUNCTION__;
287 m_webView = new QWebView;
290 m_cookieJar = new NetworkCookieJar(new QNetworkCookieJar(this));
292 m_webView->page()->networkAccessManager()->setCookieJar(m_cookieJar);
294 connect(m_webView->page()->networkAccessManager(), SIGNAL(finished(QNetworkReply*)),
295 this, SLOT(webViewRequestFinished(QNetworkReply*)));
296 connect(m_webView, SIGNAL(urlChanged(const QUrl &)),
297 this, SIGNAL(updateCredentials(QUrl)));
298 connect(m_webView, SIGNAL(loadFinished(bool)),
299 this, SLOT(loadDone(bool)));
305 void MainWindow::buildZoomButtonPanel()
307 qDebug() << __PRETTY_FUNCTION__;
309 m_zoomButtonPanel = new ZoomButtonPanel(this);
311 connect(m_zoomButtonPanel->zoomInButton(), SIGNAL(clicked()),
312 this, SIGNAL(zoomIn()));
314 connect(m_zoomButtonPanel->zoomOutButton(), SIGNAL(clicked()),
315 this, SIGNAL(zoomOut()));
317 connect(this, SIGNAL(zoomLevelChanged(int)),
318 m_zoomButtonPanel, SLOT(resetButtons()));
320 connect(this, SIGNAL(maxZoomLevelReached()),
321 m_zoomButtonPanel, SLOT(disableZoomInButton()));
323 connect(this, SIGNAL(minZoomLevelReached()),
324 m_zoomButtonPanel, SLOT(disableZoomOutButton()));
326 connect(m_mapView, SIGNAL(viewResized(QSize)),
327 m_zoomButtonPanel, SLOT(screenResized(QSize)));
330 void MainWindow::clearCookieJar()
332 qDebug() << __PRETTY_FUNCTION__;
337 m_cookieJar = new NetworkCookieJar(new QNetworkCookieJar(this));
339 QList<QNetworkCookie> emptyList;
342 m_cookieJar->setAllCookies(emptyList);
343 m_webView->page()->networkAccessManager()->setCookieJar(m_cookieJar);
346 void MainWindow::createMenus()
348 qDebug() << __PRETTY_FUNCTION__;
351 m_loginAct = new QAction(tr("Login"), this);
352 connect(m_loginAct, SIGNAL(triggered()),
353 this, SIGNAL(loginActionPressed()));
356 m_toSettingsAct = new QAction(tr("Settings"), this);
357 connect(m_toSettingsAct, SIGNAL(triggered()),
358 this, SLOT(openSettingsDialog()));
361 m_gpsToggleAct = new QAction(tr("GPS"), this);
362 m_gpsToggleAct->setCheckable(true);
364 connect(m_gpsToggleAct, SIGNAL(triggered(bool)),
365 this, SIGNAL(gpsTriggered(bool)));
367 // automatic centering
368 m_autoCenteringAct = new QAction(tr("Auto centering"), this);
369 m_autoCenteringAct->setCheckable(true);
370 connect(m_autoCenteringAct, SIGNAL(triggered(bool)),
371 this, SIGNAL(autoCenteringTriggered(bool)));
373 // build the actual menu
374 m_viewMenu = menuBar()->addMenu(tr("Main"));
375 m_viewMenu->addAction(m_loginAct);
376 m_viewMenu->addAction(m_toSettingsAct);
377 m_viewMenu->addAction(m_gpsToggleAct);
378 m_viewMenu->addAction(m_autoCenteringAct);
379 m_viewMenu->setObjectName(tr("Menu"));
382 void MainWindow::dialogFinished(int status)
384 qDebug() << __PRETTY_FUNCTION__;
386 QDialog *dialog = m_queue.takeFirst();
387 LoginDialog *loginDialog = qobject_cast<LoginDialog *>(dialog);
391 loginDialog->userInput(m_email, m_password);
393 QStringList urlParts;
394 urlParts.append(FACEBOOK_LOGINBASE);
395 urlParts.append(SITUARE_PUBLIC_FACEBOOKAPI_KEY);
396 urlParts.append(INTERVAL1);
397 urlParts.append(SITUARE_LOGIN_SUCCESS);
398 urlParts.append(INTERVAL2);
399 urlParts.append(SITUARE_LOGIN_FAILURE);
400 urlParts.append(FACEBOOK_LOGIN_ENDING);
402 emit saveUsername(m_email);
404 m_webView->load(QUrl(urlParts.join(EMPTY)));
405 toggleProgressIndicator(true);
407 emit cancelLoginProcess();
411 dialog->deleteLater();
413 if(!m_error_queue.isEmpty() && m_errorShown == false) {
414 showErrorInformationBox();
416 if(!m_queue.isEmpty()) {
417 showInformationBox();
422 void MainWindow::drawFullScreenButton(const QSize &size)
424 qDebug() << __PRETTY_FUNCTION__ << size.width() << "x" << size.height();
426 if(m_fullScreenButton) {
427 m_fullScreenButton->move(size.width() - m_fullScreenButton->size().width()
429 size.height() - m_fullScreenButton->size().height());
433 void MainWindow::drawOsmLicense(const QSize &size)
435 qDebug() << __PRETTY_FUNCTION__ << size.width() << "x" << size.height();
437 m_osmLicense->move(size.width() - m_osmLicense->fontMetrics().width(OSM_LICENSE)
439 size.height() - m_osmLicense->fontMetrics().height());
442 void MainWindow::drawOwnLocationCrosshair(int width, int height)
444 qDebug() << __PRETTY_FUNCTION__;
446 if (m_drawOwnLocationCrosshair && m_ownLocationCrosshair != 0) {
447 m_ownLocationCrosshair->move(width/2 - m_ownLocationCrosshair->pixmap()->width()/2,
448 height/2 - m_ownLocationCrosshair->pixmap()->height()/2);
452 void MainWindow::errorDialogFinished(int status)
454 qDebug() << __PRETTY_FUNCTION__;
457 QDialog *dialog = m_error_queue.takeFirst();
459 dialog->deleteLater();
460 m_errorShown = false;
462 if(!m_error_queue.isEmpty()) {
463 showErrorInformationBox();
467 void MainWindow::gpsTimeout()
469 qDebug() << __PRETTY_FUNCTION__;
471 buildInformationBox(tr("GPS timeout"));
474 void MainWindow::grabZoomKeys(bool grab)
476 qDebug() << __PRETTY_FUNCTION__;
479 // Can't grab keys unless we have a window id
483 unsigned long val = (grab) ? 1 : 0;
484 Atom atom = XInternAtom(QX11Info::display(), "_HILDON_ZOOM_KEY_ATOM", False);
488 XChangeProperty (QX11Info::display(),
494 reinterpret_cast<unsigned char *>(&val),
498 #endif // Q_WS_MAEMO_5
501 void MainWindow::keyPressEvent(QKeyEvent* event)
503 qDebug() << __PRETTY_FUNCTION__;
505 switch (event->key()) {
516 QWidget::keyPressEvent(event);
519 void MainWindow::loadCookies()
521 qDebug() << __PRETTY_FUNCTION__;
523 QSettings settings(DIRECTORY_NAME, FILE_NAME);
525 QStringList list = settings.value(COOKIES, EMPTY).toStringList();
527 if(!list.isEmpty()) {
528 QList<QNetworkCookie> cookieList;
529 for(int i=0;i<list.count();i++) {
530 cookieList.append(QNetworkCookie::parseCookies(list.at(i).toAscii()));
534 m_cookieJar = new NetworkCookieJar(new QNetworkCookieJar(this));
536 m_cookieJar->setAllCookies(cookieList);
537 m_webView->page()->networkAccessManager()->setCookieJar(m_cookieJar);
542 void MainWindow::loadDone(bool done)
544 qDebug() << __PRETTY_FUNCTION__;
546 // for the first time the login page is opened, we need to refresh it to get cookies working
554 QWebFrame* frame = m_webView->page()->currentFrame();
558 QWebElementCollection emailCollection = frame->findAllElements("input[name=email]");
560 foreach (QWebElement element, emailCollection) {
561 element.setAttribute("value", m_email.toAscii());
564 QWebElementCollection passwordCollection = frame->findAllElements("input[name=pass]");
565 foreach (QWebElement element, passwordCollection) {
566 element.setAttribute("value", m_password.toAscii());
568 // find connect button
569 QWebElementCollection buttonCollection = frame->findAllElements("input[name=login]");
570 foreach (QWebElement element, buttonCollection)
572 QPoint pos(element.geometry().center());
574 // send a mouse click event to the web page
575 QMouseEvent event0(QEvent::MouseButtonPress, pos, Qt::LeftButton, Qt::LeftButton,
577 QApplication::sendEvent(m_webView->page(), &event0);
578 QMouseEvent event1(QEvent::MouseButtonRelease, pos, Qt::LeftButton, Qt::LeftButton,
580 QApplication::sendEvent(m_webView->page(), &event1);
586 void MainWindow::loggedIn(bool logged)
588 qDebug() << __PRETTY_FUNCTION__;
593 m_loginAct->setText(tr("Logout"));
599 m_loginAct->setText(tr("Login"));
601 updateItemVisibility(m_loggedIn);
604 void MainWindow::loginFailed()
606 qDebug() << __PRETTY_FUNCTION__;
610 toggleProgressIndicator(false);
615 void MainWindow::loginUsingCookies()
617 qDebug() << __PRETTY_FUNCTION__;
622 QStringList urlParts;
623 urlParts.append(FACEBOOK_LOGINBASE);
624 urlParts.append(SITUARE_PUBLIC_FACEBOOKAPI_KEY);
625 urlParts.append(INTERVAL1);
626 urlParts.append(SITUARE_LOGIN_SUCCESS);
627 urlParts.append(INTERVAL2);
628 urlParts.append(SITUARE_LOGIN_FAILURE);
629 urlParts.append(FACEBOOK_LOGIN_ENDING);
631 m_webView->load(QUrl(urlParts.join(EMPTY)));
635 void MainWindow::openSettingsDialog()
637 qDebug() << __PRETTY_FUNCTION__;
639 m_settingsDialog->enableSituareSettings(m_gpsToggleAct->isChecked() && m_loggedIn);
640 m_settingsDialog->show();
643 void MainWindow::queueDialog(QDialog *dialog)
645 qDebug() << __PRETTY_FUNCTION__;
647 // check is dialog is modal, for now all modal dialogs have hihger priority i.e. errors
648 if(dialog->isModal()) {
649 m_error_queue.append(dialog);
651 m_queue.append(dialog);
654 // show error dialog if there is only one error dialog in the queue and no error dialog is shown
655 if(m_error_queue.count() == 1 && m_errorShown == false)
656 showErrorInformationBox();
657 else if(m_queue.count() == 1 && m_errorShown == false)
658 showInformationBox();
661 void MainWindow::saveCookies()
663 qDebug() << __PRETTY_FUNCTION__;
666 m_cookieJar = new NetworkCookieJar(new QNetworkCookieJar(this));
668 QList<QNetworkCookie> cookieList = m_cookieJar->allCookies();
671 for(int i=0;i<cookieList.count();i++) {
672 QNetworkCookie cookie = cookieList.at(i);
673 QByteArray byteArray = cookie.toRawForm(QNetworkCookie::Full);
674 list.append(QString(byteArray));
676 list.removeDuplicates();
678 QSettings settings(DIRECTORY_NAME, FILE_NAME);
679 settings.setValue(COOKIES, list);
682 void MainWindow::setAutoCenteringButtonEnabled(bool enabled)
684 qDebug() << __PRETTY_FUNCTION__;
686 m_autoCenteringAct->setChecked(enabled);
689 void MainWindow::setGPSButtonEnabled(bool enabled)
691 qDebug() << __PRETTY_FUNCTION__;
693 m_gpsToggleAct->setChecked(enabled);
696 setOwnLocationCrosshairVisibility(!enabled);
698 m_autoCenteringAct->setVisible(enabled);
701 void MainWindow::setMapViewScene(QGraphicsScene *scene)
703 qDebug() << __PRETTY_FUNCTION__;
705 m_mapView->setScene(scene);
708 void MainWindow::setOwnLocationCrosshairVisibility(bool visibility)
710 qDebug() << __PRETTY_FUNCTION__;
713 m_ownLocationCrosshair->show();
714 m_drawOwnLocationCrosshair = true;
715 drawOwnLocationCrosshair(m_viewPortWidth, m_viewPortHeight);
717 m_ownLocationCrosshair->hide();
718 m_drawOwnLocationCrosshair = false;
722 void MainWindow::setUsername(const QString &username)
724 qDebug() << __PRETTY_FUNCTION__;
729 void MainWindow::setViewPortSize(int width, int height)
731 qDebug() << __PRETTY_FUNCTION__;
733 m_viewPortWidth = width;
734 m_viewPortHeight = height;
737 void MainWindow::toggleFullScreen()
739 qDebug() << __PRETTY_FUNCTION__;
741 if(windowState() == Qt::WindowNoState)
747 void MainWindow::showErrorInformationBox()
749 qDebug() << __PRETTY_FUNCTION__;
751 if(m_error_queue.count()) {
753 QDialog *dialog = m_error_queue.first();
754 connect(dialog, SIGNAL(finished(int)),
755 this, SLOT(errorDialogFinished(int)));
760 void MainWindow::showInformationBox()
762 qDebug() << __PRETTY_FUNCTION__;
764 if(m_queue.count()) {
765 QDialog *dialog = m_queue.first();
766 connect(dialog, SIGNAL(finished(int)),
767 this, SLOT(dialogFinished(int)));
772 void MainWindow::startLoginProcess()
774 qDebug() << __PRETTY_FUNCTION__;
776 LoginDialog *loginDialog = new LoginDialog();
778 emit fetchUsernameFromSettings();
780 loginDialog->clearTextFields();
782 if(!m_email.isEmpty())
783 loginDialog->setEmailField(m_email);
785 queueDialog(loginDialog);
788 void MainWindow::toggleProgressIndicator(bool value)
790 qDebug() << __PRETTY_FUNCTION__;
793 setAttribute(Qt::WA_Maemo5ShowProgressIndicator, value);
796 #endif // Q_WS_MAEMO_5
799 void MainWindow::updateItemVisibility(bool show)
801 qDebug() << __PRETTY_FUNCTION__;
804 m_friendsListPanel->show();
805 m_friendsListPanelSidebar->show();
807 m_userPanelSidebar->show();
809 if(m_drawOwnLocationCrosshair) {
810 m_ownLocationCrosshair->show();
811 setGPSButtonEnabled(false);
812 emit gpsTriggered(false);
815 m_friendsListPanel->closePanel();
816 m_friendsListPanel->hide();
817 m_friendsListPanelSidebar->hide();
818 m_userPanel->closePanel();
820 m_userPanelSidebar->hide();
821 m_ownLocationCrosshair->hide();
825 const QString MainWindow::username()
827 qDebug() << __PRETTY_FUNCTION__;
832 void MainWindow::webViewRequestFinished(QNetworkReply *reply)
834 qDebug() << __PRETTY_FUNCTION__;
837 qDebug() << reply->error() << reply->errorString();
838 toggleProgressIndicator(false);