Logo Search packages:      
Sourcecode: wallpaper-tray version File versions  Download package

PreferencesDialog::PreferencesDialog ( BaseObjectType *  _pWindow,
const Glib::RefPtr< Gnome::Glade::Xml > &  _pGlade 
)

Construct a new preferences dialog.

<PreferencesDialog::PreferencesDialog>

Parameters:
_pWindow Required to allow this class to be instanciated from glade xml.
_pGlade Required to allow this class to be instanciated from glade xml.
Date:
12-11-2006 GAF Written

Definition at line 33 of file PreferencesDialog.cc.

References GetSettingsInGconf(), OnButtonAddDirClick(), OnButtonApplyClick(), and OnButtonRemDirClick().

  :
      Gtk::Dialog(_pWindow),
      m_pGlade(_pGlade),
      m_pButtonClose(NULL),
      m_pButtonApply(NULL),
      m_pButtonAddDir(NULL),
      m_pButtonRemDir(NULL),
      m_pEntryTime(NULL),
      m_pEntryMode(NULL),
      m_pEntrySelectionMode(NULL),
      m_pCheckButtonTimeout(NULL),
      m_pCheckButtonLogonNew(NULL),
      m_pCheckButtonImageCheck(NULL),
      m_pCheckButtonFollowLinks(NULL),
      m_pCheckButtonNotifications(NULL)
{
      // set up the gconf client
      m_pGconfClient = Gnome::Conf::Client::get_default_client();

      // get the glade instantiated widgets and connect signals
      m_pGlade->get_widget("button_close", m_pButtonClose);
      if(m_pButtonClose)
      {
            m_pButtonClose->signal_clicked().connect(sigc::mem_fun(*this, &PreferencesDialog::hide));
      }// end if

      m_pGlade->get_widget("button_apply", m_pButtonApply);
      if(m_pButtonApply)
      {
            m_pButtonApply->signal_clicked().connect(sigc::mem_fun(*this, &PreferencesDialog::OnButtonApplyClick));
      }// end if

      m_pGlade->get_widget("button_add_dir", m_pButtonAddDir);
      if(m_pButtonAddDir)
      {
            m_pButtonAddDir->signal_clicked().connect(sigc::mem_fun(*this, &PreferencesDialog::OnButtonAddDirClick));
      }// end if

      m_pGlade->get_widget("button_rem_dir", m_pButtonRemDir);
      if(m_pButtonRemDir)
      {
            m_pButtonRemDir->signal_clicked().connect(sigc::mem_fun(*this, &PreferencesDialog::OnButtonRemDirClick));
      }// end if

      m_pGlade->get_widget("entry_time", m_pEntryTime);
      m_pGlade->get_widget("combo-entry_mode", m_pEntryMode);
      m_pGlade->get_widget("combo-entry_selection_mode", m_pEntrySelectionMode);
      m_pGlade->get_widget("checkbutton_timeout", m_pCheckButtonTimeout);
      m_pGlade->get_widget("checkbutton_logon_new", m_pCheckButtonLogonNew);
      m_pGlade->get_widget("checkbutton_image_check", m_pCheckButtonImageCheck);
      m_pGlade->get_widget("checkbutton_follow_links", m_pCheckButtonFollowLinks);
      m_pGlade->get_widget("checkbutton_show_notification", m_pCheckButtonNotifications);
      
      // grab the tree view
      m_pGlade->get_widget("treeview_directories", m_pTreeView);

      if(m_pTreeView == NULL)
      {
            throw std::runtime_error("PreferencesDialog::PreferencesDialog() : failed to get widget from glade");
      }// end if

      // set up the list store and model etc
      m_pListstore = Gtk::ListStore::create(m_Model);

      m_pTreeView->set_model(m_pListstore);

      m_pTreeView->append_column(_("Directories"), m_Model.m_DirectoryName);

      // update the members/cache
      PreferencesDialog::GetSettingsInGconf();

      // populate the list
      for(std::list<Glib::ustring>::iterator it = m_lsWpDir.begin(); it != m_lsWpDir.end(); ++ it)
      {
            Gtk::TreeModel::iterator it_new = m_pListstore->append();

            (*it_new)[m_Model.m_DirectoryName] = (*it);
      }// end for

      // set the other widgets up from the gconf values
      std::ostringstream ss;
      ss.imbue(std::locale("")); // use the user's locale for this stream
      ss << m_nTimeout;
      m_pEntryTime->set_text(Glib::locale_to_utf8(ss.str()));

      m_pEntryMode->set_text(m_szPictureOptions);
      //TODO: m_pEntrySelectionMode->set_text();
      m_pCheckButtonTimeout->set_active(m_bTimeout);
      m_pCheckButtonLogonNew->set_active(m_bWpLogon);
      m_pCheckButtonImageCheck->set_active(m_bImgCheck);
      m_pCheckButtonFollowLinks->set_active(m_bFollowLinks);
      m_pCheckButtonNotifications->set_active(m_bNotifications);

      // give the window an icon
      PreferencesDialog::set_icon_from_file(GNOMEICONDIR"/wp_tray-applet.png");

      // make the PreferencesDialog window start hidden
      PreferencesDialog::hide();
}// end PreferencesDialog::PreferencesDialog


Generated by  Doxygen 1.6.0   Back to index