view libgui/src/welcome-wizard.h @ 17940:b3e4ee8f4d6d

respect option for opting out of web connections for community news * main-window.h, main-window.cc (main_window::main_window): Check settings for news/allow_web_connection. Don't load and display community news at startup if the community news web connection is disabled. (news_reader::connect_to_web): New data member. (news_reader_process): Display different messages for network unavailable and disabled web connections. Don't connect to web if connect_to_web is false. (main_window::load_and_display_community_news): Check settings for news/allow_web_connection and pass value to news_reader constructor. * welcome-wizard.h, welcome-wizard.cc (welcome_wizard::allow_web_connect_state): New data member. (welcome_wizard::handle_web_connect_option): New slot. (setup_community_news::setup_community_news): Connect checkbox signal to welcome_wizard::handle_web_connect_option. (welcome_wizard::accept): New slot. Initialize resources here.
author John W. Eaton <jwe@octave.org>
date Sat, 16 Nov 2013 12:05:26 -0500
parents f87a7e161710
children 866d3860724c
line wrap: on
line source

/*

Copyright (C) 2013 John W. Eaton
Copyright (C) 2011-2013 Jacob Dawid

This file is part of Octave.

Octave 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 3 of the License, or (at your
option) any later version.

Octave 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 Octave; see the file COPYING.  If not, see
<http://www.gnu.org/licenses/>.

*/

#ifndef WELCOMEWIZARD_H
#define WELCOMEWIZARD_H

#include <QDialog>

class welcome_wizard : public QDialog
{
  Q_OBJECT

public:

  typedef QWidget *(*page_creator_fptr) (welcome_wizard *wizard);

  welcome_wizard (QWidget *parent = 0);

  ~welcome_wizard (void) { }

private:

  QList<page_creator_fptr> page_ctor_list;
  QList<page_creator_fptr>::iterator page_list_iterator;
  QWidget *current_page;
  bool allow_web_connect_state;

private slots:

  void handle_web_connect_option (int state);

  void show_page (void);
  void previous_page (void);
  void next_page (void);

  void accept (void);
};

#endif // WELCOMEWIZARD_H