Vidalia  0.2.17
RouterInfoDialog.h
Go to the documentation of this file.
00001 /*
00002 **  This file is part of Vidalia, and is subject to the license terms in the
00003 **  LICENSE file, found in the top level directory of this distribution. If you
00004 **  did not receive the LICENSE file with this file, you may obtain it from the
00005 **  Vidalia source package distributed by the Vidalia Project at
00006 **  http://www.torproject.org/projects/vidalia.html. No part of Vidalia, 
00007 **  including this file, may be copied, modified, propagated, or distributed 
00008 **  except according to the terms described in the LICENSE file.
00009 */
00010 
00011 /*
00012 ** \file RouterInfoDialog.h
00013 ** \brief Displays detailed information about a particular router
00014 */
00015 
00016 
00017 #ifndef _ROUTERINFODIALOG_H
00018 #define _ROUTERINFODIALOG_H
00019 
00020 #include "ui_RouterInfoDialog.h"
00021 
00022 #include "RouterStatus.h"
00023 #include "RouterDescriptor.h"
00024 
00025 #include <QDialog>
00026 
00027 
00028 class RouterInfoDialog : public QDialog
00029 {
00030   Q_OBJECT
00031 
00032 public:
00033   /** Default constructor.
00034    */
00035   RouterInfoDialog(QWidget *parent = 0);
00036 
00037   /** Populates the dialog's UI with information parsed from the router
00038    * descriptor <b>desc</b> and the router status information in
00039    * <b>status</b>.
00040    */
00041   void setRouterInfo(const QStringList &desc, const RouterStatus &status);
00042 
00043   /** Sets the geographic location information displayed in the dialog to
00044    * <b>location</b>.
00045    */
00046   void setLocation(const QString &location);
00047 
00048 private:
00049   /** Adjusts <b>uptime</b> to be the greater of either <b>published</b> or
00050    * <b>uptime</b> plus the number of seconds elapsed since <b>published</b>.
00051    */
00052   quint64 adjustUptime(quint64 uptime, const QDateTime &published);
00053 
00054   Ui::RouterInfoDialog ui;
00055 };
00056 
00057 #endif
00058