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

Wallpapers::Wallpapers ( Applet _pApplet  ) 

Create a new wallpaper manager class.

<Wallpapers::Wallpapers>

Parameters:
_pApplet A pointer to the containing panel applet.
Date:
12-06-2006 GAF Written

Definition at line 32 of file Wallpapers.cc.

References RegenerateTimeout(), and SetRandomDelayed().

  :
      m_regexImageCheck("(.*).jpg|(.*).jpeg|(.*).png|(.*).gif|(.*).bmp|(.*).tiff", boost::regex::icase),
      m_pApplet(_pApplet),
      m_Notify(_pApplet, this)
{
      boost::filesystem::path::default_name_check(fnNameCheckYes);
      
      // set up the gconf client
      m_pGconfClient = Gnome::Conf::Client::get_default_client();
      
      m_pGconfClient->add_dir("/apps/wp_tray");

      // seed random number generator
      std::srand(std::time(NULL));

      // create wallpaper change timeout
      if(m_pGconfClient->get_bool("/apps/wp_tray/b_timeout") == true)
      {
            // set the wallpaper timeout
            m_sigcConnection = Glib::signal_timeout().connect     (
                        sigc::mem_fun(this, &Wallpapers::SetRandomDelayed),
                        m_pGconfClient->get_int("/apps/wp_tray/n_timeout") * 60 * 1000
                  );
      }// end if

      // listen to changes to our keys
      m_pGconfClient->notify_add    (
                  "/apps/wp_tray/b_timeout",
                  sigc::mem_fun(*this, &Wallpapers::RegenerateTimeout)
            );
      m_pGconfClient->notify_add    (
                  "/apps/wp_tray/n_timeout",
                  sigc::mem_fun(*this, &Wallpapers::RegenerateTimeout)
            );
}// end Wallpapers::Wallpapers


Generated by  Doxygen 1.6.0   Back to index