guicommon/MarketClientAssistant.hpp
Go to the documentation of this file.
00001 /*
00002   This file is part of OpenFLUID software
00003   Copyright (c) 2007-2010 INRA-Montpellier SupAgro
00004 
00005 
00006  == GNU General Public License Usage ==
00007 
00008   OpenFLUID is free software: you can redistribute it and/or modify
00009   it under the terms of the GNU General Public License as published by
00010   the Free Software Foundation, either version 3 of the License, or
00011   (at your option) any later version.
00012 
00013   OpenFLUID is distributed in the hope that it will be useful,
00014   but WITHOUT ANY WARRANTY; without even the implied warranty of
00015   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016   GNU General Public License for more details.
00017 
00018   You should have received a copy of the GNU General Public License
00019   along with OpenFLUID.  If not, see <http://www.gnu.org/licenses/>.
00020 
00021   In addition, as a special exception, INRA gives You the additional right
00022   to dynamically link the code of OpenFLUID with code not covered
00023   under the GNU General Public License ("Non-GPL Code") and to distribute
00024   linked combinations including the two, subject to the limitations in this
00025   paragraph. Non-GPL Code permitted under this exception must only link to
00026   the code of OpenFLUID dynamically through the OpenFLUID libraries
00027   interfaces, and only for building OpenFLUID plugins. The files of
00028   Non-GPL Code may be link to the OpenFLUID libraries without causing the
00029   resulting work to be covered by the GNU General Public License. You must
00030   obey the GNU General Public License in all respects for all of the
00031   OpenFLUID code and other code used in conjunction with OpenFLUID
00032   except the Non-GPL Code covered by this exception. If you modify
00033   this OpenFLUID, you may extend this exception to your version of the file,
00034   but you are not obligated to do so. If you do not wish to provide this
00035   exception without modification, you must delete this exception statement
00036   from your version and license this OpenFLUID solely under the GPL without
00037   exception.
00038 
00039 
00040  == Other Usage ==
00041 
00042   Other Usage means a use of OpenFLUID that is inconsistent with the GPL
00043   license, and requires a written agreement between You and INRA.
00044   Licensees for Other Usage of OpenFLUID may use this file in accordance
00045   with the terms contained in the written agreement between You and INRA.
00046  */
00047 
00056 #ifndef __MARKETCLIENTASSISTANT_HPP__
00057 #define __MARKETCLIENTASSISTANT_HPP__
00058 
00059 #include <gtkmm/assistant.h>
00060 #include <gtkmm/box.h>
00061 #include <gtkmm/label.h>
00062 #include <gtkmm/combobox.h>
00063 #include <gtkmm/liststore.h>
00064 #include <gtkmm/scrolledwindow.h>
00065 #include <gtkmm/button.h>
00066 #include <gtkmm/radiobutton.h>
00067 #include <gtkmm/alignment.h>
00068 #include <gtkmm/progressbar.h>
00069 #include <gtkmm/textview.h>
00070 
00071 #include <openfluid/dllexport.hpp>
00072 #include <openfluid/market/MarketClient.hpp>
00073 
00074 
00075 namespace openfluid { namespace guicommon {
00076 
00077 class MarketPackWidget;
00078 
00079 
00080 class DLLEXPORT MarketClientAssistant : public Gtk::Assistant
00081 {
00082 
00083   private:
00084 
00085     // ===== Package selection =====//
00086     Gtk::VBox m_SelectionPageBox;
00087 
00088     Gtk::HBox m_URLBox;
00089     Gtk::Label m_URLLabel;
00090     Gtk::ComboBox m_URLCombo;
00091     Glib::RefPtr<Gtk::ListStore> m_RefURLComboBoxModel;
00092 
00093     class URLComboColumns : public Gtk::TreeModel::ColumnRecord
00094     {
00095       public:
00096 
00097         Gtk::TreeModelColumn<Glib::ustring> m_Name;
00098         Gtk::TreeModelColumn<Glib::ustring> m_URL;
00099 
00100         URLComboColumns() { add(m_Name); add(m_URL); }
00101     };
00102 
00103     URLComboColumns m_URLColumns;
00104 
00105 
00106     Gtk::VBox m_AvailPacksBox;
00107 
00108     Gtk::ScrolledWindow m_AvailPacksSWindow;
00109 
00110     Gtk::HBox m_ActionButtonsBox;
00111     Gtk::Button m_SelectAllButton;
00112     Gtk::Button m_SelectNoneButton;
00113     Gtk::Button m_CommonBuildConfigButton;
00114 
00115     std::list<MarketPackWidget*> mp_AvailPacksWidgets;
00116 
00117     void onURLComboChanged();
00118 
00119     void onPackageInstallModified();
00120 
00121     void onSelectAllClicked();
00122 
00123     void onSelectNoneClicked();
00124 
00125     void onCommonBuildConfigClicked();
00126 
00127 
00128     // ===== Licenses =====//
00129     Gtk::VBox m_LicensesPageBox;
00130 
00131     Gtk::Label m_LicensesLabel;
00132 
00133     Gtk::HBox m_LicensesReviewBox;
00134     Gtk::TreeView m_LicensesTreeView;
00135 
00136     Glib::RefPtr<Gtk::ListStore> m_RefLicenseTreeViewModel;
00137 
00138     class LicensesTreeViewColumns : public Gtk::TreeModel::ColumnRecord
00139     {
00140       public:
00141 
00142         Gtk::TreeModelColumn<Glib::ustring> m_ID;
00143 
00144         LicensesTreeViewColumns() { add(m_ID); }
00145     };
00146 
00147     LicensesTreeViewColumns m_LicensesColumns;
00148 
00149     Glib::RefPtr<Gtk::TreeSelection> m_RefLicensesTreeSelection;
00150 
00151     Gtk::TextView m_LicensesTextView;
00152 
00153     Glib::RefPtr<Gtk::TextBuffer> m_RefLicenseTextBuffer;
00154 
00155 
00156     Gtk::ScrolledWindow m_LicensesListSWindow;
00157     Gtk::ScrolledWindow m_LicensesReviewSWindow;
00158 
00159     Gtk::RadioButton m_LicensesAcceptRadio;
00160     Gtk::RadioButton m_LicensesDoNotRadio;
00161 
00162 
00163     void onLicensesTreeviewChanged();
00164 
00165     void onLicenseRadioClicked();
00166 
00167     // ===== Download and install =====//
00168     Gtk::VBox m_InstallPageBox;
00169 
00170     Gtk::TreeView m_InstallTreeView;
00171     Glib::RefPtr<Gtk::TreeView> m_RefInstallTreeView;
00172 
00173     Glib::RefPtr<Gtk::ListStore> m_RefInstallTreeViewModel;
00174 
00175     class InstallTreeViewColumns : public Gtk::TreeModel::ColumnRecord
00176     {
00177       public:
00178 
00179         Gtk::TreeModelColumn<Glib::ustring> m_ID;
00180         Gtk::TreeModelColumn<Glib::ustring> m_Format;
00181         Gtk::TreeModelColumn<Glib::ustring> m_Status;
00182 
00183         InstallTreeViewColumns() { add(m_ID); add(m_Format); add(m_Status);}
00184     };
00185 
00186     InstallTreeViewColumns m_InstallColumns;
00187 
00188 
00189     Gtk::ScrolledWindow m_InstallSWindow;
00190     Gtk::ProgressBar m_InstallProgressBar;
00191     Gtk::Button m_ViewLogButton;
00192     Gtk::Alignment m_LogButtonAlign;
00193 
00194     void onInstallTimeoutOnce();
00195 
00196     void onViewLogClicked();
00197 
00198 
00199     void setupSelectionPage();
00200     void setupConfirmationPage();
00201     void setupLicensesPage();
00202     void setupDownloadPage();
00203 
00204 
00205     void onApply();
00206     void onCancel();
00207     void onClose();
00208     void onPrepare(Gtk::Widget* Widget);
00209 
00210     void updateAvailPacksTreeview();
00211 
00212     void updateInstallTreeview();
00213 
00214     void initializeLicencesTreeView();
00215 
00216     openfluid::market::MarketClient m_MarketClient;
00217 
00218     int m_InstallationTimeout;
00219 
00220   public:
00221     MarketClientAssistant();
00222 
00223     virtual ~MarketClientAssistant();
00224 
00225 
00226 };
00227 
00228 } } //namespaces
00229 
00230 
00231 #endif /* __MARKETCLIENTASSISTANT_HPP__ */

Generated using Doxygen 1.7.6.1
Creative Commons License Creative Commons By-NC-ND license