Changeset 433

Show
Ignore:
Timestamp:
03/16/06 03:53:54 (3 years ago)
Author:
hipplej
Message:

Rough out a form for the help system.

Location:
trunk/src/gui
Files:
3 added
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/help/browser/browser.pri

    r420 r433  
     1################################################################# 
     2#  $Id$ 
     3# 
     4#  Vidalia is distributed under the following license: 
     5# 
     6#  Copyright (C) 2006,  Matt Edman, Justin Hipple 
     7# 
     8#  This program is free software; you can redistribute it and/or 
     9#  modify it under the terms of the GNU General Public License 
     10#  as published by the Free Software Foundation; either version 2 
     11#  of the License, or (at your option) any later version. 
     12# 
     13#  This program is distributed in the hope that it will be useful, 
     14#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
     15#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     16#  GNU General Public License for more details. 
     17# 
     18#  You should have received a copy of the GNU General Public License 
     19#  along with this program; if not, write to the Free Software 
     20#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA   
     21#  02110-1301, USA. 
     22################################################################# 
     23 
     24FORMS += $$PWD/helpbrowser.ui 
     25 
     26HEADERS += $$PWD/helpbrowser.h 
     27 
     28SOURCES += $$PWD/helpbrowser.cpp 
  • trunk/src/gui/log/messagelog.h

    r356 r433  
    143143 
    144144#endif 
     145 
  • trunk/src/gui/mainwindow.cpp

    r356 r433  
    8181  Qt::WFlags bw_flags = (Qt::Tool | Qt::WindowStaysOnTopHint); 
    8282  _bandwidthGraph = new BandwidthGraph(_torControl, this, bw_flags); 
     83  
     84  /* Create a new HelpBrowser object so we can display help to the user */ 
     85  _helpBrowser = new HelpBrowser(this); 
    8386   
    8487  /* Put an icon in the system tray to indicate the status of Tor */ 
     
    186189  connect(_messageAct, SIGNAL(triggered()), 
    187190      this, SLOT(showMessageLog())); 
     191 
     192  _helpAct = new QAction(tr("Help"), this); 
     193  connect(_helpAct, SIGNAL(triggered()),  
     194      this, SLOT(showHelp())); 
    188195} 
    189196 
     
    204211  _trayMenu->addSeparator(); 
    205212  _trayMenu->addAction(_configAct); 
     213  _trayMenu->addAction(_helpAct); 
    206214  _trayMenu->addAction(_aboutAct); 
    207215  _trayMenu->addSeparator(); 
     
    239247  _viewMenu->addAction(_configAct); 
    240248  _helpMenu = _menuBar->addMenu(tr("Help")); 
     249  _helpMenu->addAction(_helpAct); 
    241250  _helpMenu->addAction(_aboutAct); 
    242251#endif 
     
    451460} 
    452461 
     462/** Shows Help Browser. If the browser is already displayed, the existing 
     463 * instance will be brought to the foreground. */ 
     464void 
     465MainWindow::showHelp() 
     466{ 
     467  if(!_helpBrowser->isVisible()) { 
     468    _helpBrowser->show(); 
     469  } else { 
     470    _helpBrowser->activateWindow(); 
     471    _helpBrowser->raise(); 
     472  } 
     473} 
     474 
  • trunk/src/gui/mainwindow.h

    r422 r433  
    3737#include "bwgraph/bwgraph.h" 
    3838#include "config/configdialog.h" 
     39#include "help/browser/helpbrowser.h" 
    3940 
    4041 
     
    7475  /** Called when the user selects "Configuration" from the menu. */ 
    7576  void showConfig(); 
     77  /** Called when the user selects "Help" from the menu. */ 
     78  void showHelp(); 
    7679  /** Called when the user exits Vidalia. */ 
    7780  void close(); 
     
    9699  /** A BandwidthGraph object which handles monitoring Tor bandwidth usage */ 
    97100  BandwidthGraph* _bandwidthGraph; 
     101  /** A HelpBrowser object which handles displaying help files */ 
     102  HelpBrowser* _helpBrowser; 
    98103  /** A TorControl object that handles communication with Tor */ 
    99104  TorControl* _torControl;  
    100105  /** Instance of a tray icon that will appear in the system tray */ 
    101   TrayIcon* _trayIcon;  
     106  TrayIcon* _trayIcon; 
    102107   
    103108  /** Define the popup menus for the system tray icon */ 
     
    111116  QAction* _bandwidthAct; 
    112117  QAction* _messageAct; 
     118  QAction* _helpAct; 
    113119 
    114120/* GUI elements unique on Mac so we can use the system menubar */ 
  • trunk/src/gui/res/vidalia.qrc

    r419 r433  
    1717        <file>tor_on128.png</file> 
    1818        <file>tor_on32.png</file> 
    19         <!-- 
    2019        <file>forward.png</file> 
    2120        <file>back.png</file> 
    2221        <file>home.png</file> 
    2322        <file>search.png</file> 
    24         --> 
    2523    </qresource> 
    2624    <qresource prefix="/docs">