Commit 42c6d271 authored by Matt Edman's avatar Matt Edman
Browse files

Display the descriptor when the user selects a router from the list. We'll

have to come up with a more readable way to format some of the information,
but this is a start.


svn:r743
parent 0bac560c
Loading
Loading
Loading
Loading
+2 −0
Changes for src/control/routerdescriptor.h: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -42,6 +42,8 @@ public:
    Offline       /**< Router is unresponsive. */
  };

  /** Default constructor. */
  RouterDescriptor() {}
  /** Constructor. */
  RouterDescriptor(QString id); 
  /** Constructor. */ 
+2 −0
Changes for src/gui/network/netviewer.cpp: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -55,6 +55,8 @@ NetViewer::NetViewer(QWidget *parent)
          ui.treeRouterList, SLOT(load()));
  connect(_torControl, SIGNAL(connected(bool)),
          ui.actionRefresh, SLOT(setEnabled(bool)));
  connect(ui.treeRouterList, SIGNAL(routerSelected(RouterDescriptor)),
          ui.textRouterInfo, SLOT(display(RouterDescriptor)));
}

/** Overloads the default show() slot. */
+8 −1
Changes for src/gui/network/netviewer.ui: 8 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -407,7 +407,7 @@
        </item>
       </layout>
      </widget>
      <widget class="QTextBrowser" name="textRouterInfo" >
      <widget class="RouterDescriptorView" name="textRouterInfo" >
       <property name="sizePolicy" >
        <sizepolicy>
         <hsizetype>7</hsizetype>
@@ -572,5 +572,12 @@
   <container>0</container>
   <pixmap></pixmap>
  </customwidget>
  <customwidget>
   <class>RouterDescriptorView</class>
   <extends>QTextEdit</extends>
   <header>gui/network/routerdescriptorview.h</header>
   <container>0</container>
   <pixmap></pixmap>
  </customwidget>
 </customwidgets>
</ui>
+4 −2
Changes for src/gui/network/network.pri: 4 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -25,9 +25,11 @@ FORMS += $$PWD/netviewer.ui

HEADERS += $$PWD/netviewer.h \
           $$PWD/mapframe.h \
           $$PWD/routerlistwidget.h
           $$PWD/routerlistwidget.h \
           $$PWD/routerdescriptorview.h

SOURCES += $$PWD/netviewer.cpp \
           $$PWD/mapframe.cpp \
           $$PWD/routerlistwidget.cpp
           $$PWD/routerlistwidget.cpp \
           $$PWD/routerdescriptorview.cpp
+42 −0
Changes for src/gui/network/routerdescriptorview.cpp: 42 added lines, 0 removed lines.
Original line number Diff line number Diff line
/****************************************************************
 *  Vidalia is distributed under the following license:
 *
 *  Copyright (C) 2006,  Matt Edman, Justin Hipple
 *
 *  This program is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License
 *  as published by the Free Software Foundation; either version 2
 *  of the License, or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, 
 *  Boston, MA  02110-1301, USA.
 ****************************************************************/

/** 
 * \file routerdescriptorview.cpp
 * \version $Id$
 */

#include "routerdescriptorview.h"


/** Default constructor. */
RouterDescriptorView::RouterDescriptorView(QWidget *parent)
: QTextEdit(parent)
{
}

/** Displays the given router descriptor. */
void
RouterDescriptorView::display(RouterDescriptor rd)
{
  setPlainText(rd.descriptor());
}
Loading