rpms/wp_tray/devel wp_tray-0.5.3-gnomewp.patch, NONE, 1.1 wp_tray.spec, 1.7, 1.8
Denis Leroy (denis)
fedora-extras-commits at redhat.com
Tue May 8 21:58:09 UTC 2007
- Previous message (by thread): rpms/php-pear-HTML-QuickForm-ElementGrid/devel .cvsignore, 1.2, 1.3 php-pear-HTML-QuickForm-ElementGrid.spec, 1.1, 1.2 sources, 1.2, 1.3
- Next message (by thread): rpms/rosegarden4/FC-6 rosegarden-1.5.1-desktop-file.patch, NONE, 1.1 rosegarden-1.5.1-lib64.patch, NONE, 1.1 .cvsignore, 1.3, 1.4 rosegarden4.spec, 1.4, 1.5 sources, 1.3, 1.4 rosegarden-4-1.2.3-lib64.patch, 1.1, NONE rosegarden-4-desktop-file.patch, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: denis
Update of /cvs/pkgs/rpms/wp_tray/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv7063
Modified Files:
wp_tray.spec
Added Files:
wp_tray-0.5.3-gnomewp.patch
Log Message:
Added patch to make gnome wp addition optional, minor glade fixes
wp_tray-0.5.3-gnomewp.patch:
--- NEW FILE wp_tray-0.5.3-gnomewp.patch ---
--- wp_tray-0.5.3/src/wp_tray_conf.glade.orig 2007-05-08 23:20:42.000000000 +0200
+++ wp_tray-0.5.3/src/wp_tray_conf.glade 2007-05-08 23:31:35.000000000 +0200
@@ -76,6 +76,7 @@
<child>
<widget class="GtkNotebook" id="notebook1">
+ <property name="border_width">4</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="show_tabs">True</property>
@@ -102,7 +103,7 @@
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
<property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
@@ -374,7 +375,7 @@
<child>
<widget class="GtkLabel" id="label4">
<property name="visible">True</property>
- <property name="label" translatable="yes">_Picture Selection Mode:</property>
+ <property name="label" translatable="yes">Picture _Selection Mode:</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -552,6 +553,25 @@
<property name="fill">False</property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkCheckButton" id="checkbutton_use_statics">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Add GNOME Wallpapers to the List</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="padding">0</property>
--- wp_tray-0.5.3/src/wp_tray_search.glade.orig 2007-05-08 23:20:51.000000000 +0200
+++ wp_tray-0.5.3/src/wp_tray_search.glade 2007-05-08 23:32:45.000000000 +0200
@@ -10,7 +10,7 @@
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_CENTER</property>
<property name="modal">False</property>
- <property name="resizable">False</property>
+ <property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
@@ -193,7 +193,7 @@
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
@@ -270,7 +270,7 @@
<widget class="GtkRadioButton" id="radiobutton_delete">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Deleted selected wallpapers.</property>
+ <property name="label" translatable="yes">Delete selected wallpapers.</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
--- wp_tray-0.5.3/src/Wallpapers.cc.orig 2007-05-08 23:39:41.000000000 +0200
+++ wp_tray-0.5.3/src/Wallpapers.cc 2007-05-08 23:42:11.000000000 +0200
@@ -6,66 +6,66 @@
* Dialog derivation that implements Wallpaper Tray search tool.
*
*-----------------------------------------------------------------------------
- */
-
-#include "Wallpapers.hh"
-#include <iostream>
-#include <cstdlib>
-#include <boost/filesystem/exception.hpp>
-#include <glibmm.h>
-#include "GnomeWPList.hh"
-#include "Applet.hh"
-
-bool fnNameCheckYes(const std::string &) { return true; }
-
+ */
+
+#include "Wallpapers.hh"
+#include <iostream>
+#include <cstdlib>
+#include <boost/filesystem/exception.hpp>
+#include <glibmm.h>
+#include "GnomeWPList.hh"
+#include "Applet.hh"
+
+bool fnNameCheckYes(const std::string &) { return true; }
+
//------------------------------------------------------------------------
/**
<Wallpapers::Wallpapers>
@brief Create a new wallpaper manager class.
-
+
@param _pApplet A pointer to the containing panel applet.
@date 12-06-2006 GAF Written
**/
-//------------------------------------------------------------------------
-Wallpapers::Wallpapers
-(
- Applet * _pApplet
-) :
- 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
-
+//------------------------------------------------------------------------
+Wallpapers::Wallpapers
+(
+ Applet * _pApplet
+) :
+ 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
+
//------------------------------------------------------------------------
/**
<Wallpapers::~Wallpapers>
@@ -73,156 +73,158 @@
@date 12-06-2006 GAF Written
**/
-//------------------------------------------------------------------------
-Wallpapers::~Wallpapers
-(
-)
-{
- // ...
-}// end Wallpapers::~Wallpapers
-
-
+//------------------------------------------------------------------------
+Wallpapers::~Wallpapers
+(
+)
+{
+ // ...
+}// end Wallpapers::~Wallpapers
+
+
//------------------------------------------------------------------------
/**
<Wallpapers::SetRandom>
@brief Set a random wallpaper from the user configured directories.
-
+
@param _bImediate Whether or not the change should wait for user confirmation.
@date 12-06-2006 GAF Written
**/
-//------------------------------------------------------------------------
-bool Wallpapers::SetRandom
-(
- bool _bImediate
-)
-{
- std::size_t nFileCount(0);
- std::size_t nStaticCount(0);
-
- // grab all the directories
- std::list<Glib::ustring> lsWpDir = m_pGconfClient->get_string_list("/apps/wp_tray/dir_list");
-
- for(std::list<Glib::ustring>::iterator it = lsWpDir.begin(); it != lsWpDir.end(); ++ it)
- {
- // recurse each path to count wallpapers
- Wallpapers::CountDirectoryEntries(it->c_str(), nFileCount);
- }// end for
-
- nStaticCount = Wallpapers::CountStatics();
-
- if(nFileCount == 0 && nStaticCount == 0)
- {
- return false;
- }// end if
-
+//------------------------------------------------------------------------
+bool Wallpapers::SetRandom
+(
+ bool _bImediate
+)
+{
+ std::size_t nFileCount(0);
+ std::size_t nStaticCount(0);
+
+ // grab all the directories
+ std::list<Glib::ustring> lsWpDir = m_pGconfClient->get_string_list("/apps/wp_tray/dir_list");
+ bool use_statics = m_pGconfClient->get_bool("/apps/wp_tray/b_use_statics");
+
+ for(std::list<Glib::ustring>::iterator it = lsWpDir.begin(); it != lsWpDir.end(); ++ it)
+ {
+ // recurse each path to count wallpapers
+ Wallpapers::CountDirectoryEntries(it->c_str(), nFileCount);
+ }// end for
+
+ if (use_statics)
+ nStaticCount = Wallpapers::CountStatics();
+
+ if(nFileCount == 0 && nStaticCount == 0)
+ {
+ return false;
+ }// end if
+
// get random image index
- std::size_t nRandomIndex = (std::rand() % (nFileCount + nStaticCount)) + 1;
-
- if(nRandomIndex <= nFileCount)
- {
- for(std::list<Glib::ustring>::iterator it = lsWpDir.begin(); it != lsWpDir.end(); ++ it)
- {
- // recurse each path to get random wallpaper
- Wallpapers::GetDirectoryEntryAtIndex(it->c_str(), nRandomIndex, m_szFile);
- }// end for
- }// end if
- else
- {
- m_szFile = Wallpapers::GetStaticAtIndex(nRandomIndex % nStaticCount);
- }// end else
-
- // set new in gconf
- if(m_szFile.length() > 0)
- {
- m_pApplet->RenderThumbnail(m_szFile);
-
- if(_bImediate == true)
- {
- m_pGconfClient->set("/desktop/gnome/background/picture_filename", m_szFile);
-
- m_pApplet->SetThumbnailOnPanel();
- }// end if
- else
- {
- m_Notify.WallpaperChanged(m_szFile);
- }// end else
- }// end if
-
- return true;
-}// end Wallpapers::set_random
-
+ std::size_t nRandomIndex = (std::rand() % (nFileCount + nStaticCount)) + 1;
+
+ if(nRandomIndex <= nFileCount)
+ {
+ for(std::list<Glib::ustring>::iterator it = lsWpDir.begin(); it != lsWpDir.end(); ++ it)
+ {
+ // recurse each path to get random wallpaper
+ Wallpapers::GetDirectoryEntryAtIndex(it->c_str(), nRandomIndex, m_szFile);
+ }// end for
+ }// end if
+ else
+ {
+ m_szFile = Wallpapers::GetStaticAtIndex(nRandomIndex % nStaticCount);
+ }// end else
+
+ // set new in gconf
+ if(m_szFile.length() > 0)
+ {
+ m_pApplet->RenderThumbnail(m_szFile);
+
+ if(_bImediate == true)
+ {
+ m_pGconfClient->set("/desktop/gnome/background/picture_filename", m_szFile);
+
+ m_pApplet->SetThumbnailOnPanel();
+ }// end if
+ else
+ {
+ m_Notify.WallpaperChanged(m_szFile);
+ }// end else
+ }// end if
+
+ return true;
+}// end Wallpapers::set_random
+
//------------------------------------------------------------------------
/**
<Wallpapers::SetRandomDelayed>
@brief Have a wallpaper set, first giving the user the chance to block the change using libnotify.
-
+
@return Whether the wallpaper change was successful.
@date 12-06-2006 GAF Written
**/
-//------------------------------------------------------------------------
-bool Wallpapers::SetRandomDelayed
-(
-)
-{
- return Wallpapers::SetRandom(false);
-}// end Wallpapers::SetRandomImmediate
-
+//------------------------------------------------------------------------
+bool Wallpapers::SetRandomDelayed
+(
+)
+{
+ return Wallpapers::SetRandom(false);
+}// end Wallpapers::SetRandomImmediate
+
//------------------------------------------------------------------------
/**
<Wallpapers::GetCurrent>
@brief Gets the location of the current wallpaper on disk.
-
+
@return The location of the current wallpaper on disk.
@date 12-06-2006 GAF Written
**/
-//------------------------------------------------------------------------
-Glib::ustring Wallpapers::GetCurrent
-(
-)
-{
- return m_pGconfClient->get_string("/desktop/gnome/background/picture_filename");
-}// end Wallpapers::get_current
-
+//------------------------------------------------------------------------
+Glib::ustring Wallpapers::GetCurrent
+(
+)
+{
+ return m_pGconfClient->get_string("/desktop/gnome/background/picture_filename");
+}// end Wallpapers::get_current
+
//------------------------------------------------------------------------
/**
<Wallpapers::DeleteCurrent>
@brief Delete the current wallpaper from disk.
-
+
@return Whether or not the wallpaper was deleted.
@date 12-06-2006 GAF Written
**/
-//------------------------------------------------------------------------
-bool Wallpapers::DeleteCurrent
-(
-)
-{
- Glib::ustring szWpPath(m_pGconfClient->get_string("/desktop/gnome/background/picture_filename"));
-
- if(szWpPath.length() == 0)
- {
- return false;
- }// end if
-
- // attempt to remove the file
- try
- {
- fs::path pathWp(szWpPath.c_str(), fs::native);
-
- if(fs::exists(pathWp) == false)
- {
- return false;
- }// end if
-
- fs::remove(pathWp);
- }// end try
- catch(fs::filesystem_error e)
- {
- return false;
- }// end catch
-
- return Wallpapers::SetRandom(true);
-}// end Wallpapers::DeleteCurrent
-
+//------------------------------------------------------------------------
+bool Wallpapers::DeleteCurrent
+(
+)
+{
+ Glib::ustring szWpPath(m_pGconfClient->get_string("/desktop/gnome/background/picture_filename"));
+
+ if(szWpPath.length() == 0)
+ {
+ return false;
+ }// end if
+
+ // attempt to remove the file
+ try
+ {
+ fs::path pathWp(szWpPath.c_str(), fs::native);
+
+ if(fs::exists(pathWp) == false)
+ {
+ return false;
+ }// end if
+
+ fs::remove(pathWp);
+ }// end try
+ catch(fs::filesystem_error e)
+ {
+ return false;
+ }// end catch
+
+ return Wallpapers::SetRandom(true);
+}// end Wallpapers::DeleteCurrent
+
//------------------------------------------------------------------------
/**
<Wallpapers::AcceptChange>
@@ -230,16 +232,16 @@
@date 12-06-2006 GAF Written
**/
-//------------------------------------------------------------------------
-void Wallpapers::AcceptChange
-(
-)
-{
- m_pGconfClient->set("/desktop/gnome/background/picture_filename", m_szFile);
-
- m_pApplet->SetThumbnailOnPanel();
-}// end Wallpapers::AcceptChange
-
+//------------------------------------------------------------------------
+void Wallpapers::AcceptChange
+(
+)
+{
+ m_pGconfClient->set("/desktop/gnome/background/picture_filename", m_szFile);
+
+ m_pApplet->SetThumbnailOnPanel();
+}// end Wallpapers::AcceptChange
+
//------------------------------------------------------------------------
/**
<Wallpapers::RejectChange>
@@ -247,14 +249,14 @@
@date 12-06-2006 GAF Written
**/
-//------------------------------------------------------------------------
-void Wallpapers::RejectChange
-(
-)
-{
- // do nowt
-}// end Wallpapers::RejectChange
-
+//------------------------------------------------------------------------
+void Wallpapers::RejectChange
+(
+)
+{
+ // do nowt
+}// end Wallpapers::RejectChange
+
//------------------------------------------------------------------------
/**
<Wallpapers::DeleteChange>
@@ -262,214 +264,214 @@
@date 12-06-2006 GAF Written
**/
-//------------------------------------------------------------------------
-void Wallpapers::DeleteChange
-(
-)
-{
- m_pGconfClient->set("/desktop/gnome/background/picture_filename", m_szFile);
-
- Wallpapers::DeleteCurrent();
-}// end Wallpapers::DeleteChange
-
+//------------------------------------------------------------------------
+void Wallpapers::DeleteChange
+(
+)
+{
+ m_pGconfClient->set("/desktop/gnome/background/picture_filename", m_szFile);
+
+ Wallpapers::DeleteCurrent();
+}// end Wallpapers::DeleteChange
+
//------------------------------------------------------------------------
/**
<Wallpapers::CountDirectoryEntries>
@brief Recursive method to count the files in all the directories the user is monitoring.
-
- at param _pathCurrent Boost path giving the current directory/path in recursion.
- at param _nFileCount Number of files the algorithm has hit so far.
+
+ at param _pathCurrent Boost path giving the current directory/path in recursion.
+ at param _nFileCount Number of files the algorithm has hit so far.
@return The file count.
@date 12-06-2006 GAF Written
**/
-//------------------------------------------------------------------------
-std::size_t Wallpapers::CountDirectoryEntries
-(
- fs::path _pathCurrent,
- std::size_t & _nFileCount
-)
-{
- fs::directory_iterator itEnd;
-
- for(fs::directory_iterator it(_pathCurrent); it != itEnd; ++ it)
- {
- try
- {
- // is it a directory and not hidden?
- if(fs::is_directory(*it) && it->leaf()[0] != '.')
- {
- if(fs::symbolic_link_exists(*it))
- {
- if(m_pGconfClient->get_bool("/apps/wp_tray/b_follow_links") == true)
- {
- // recurse
- Wallpapers::CountDirectoryEntries(*it, _nFileCount);
- }// end if
- }// end if
- else
- {
- // recurse
- Wallpapers::CountDirectoryEntries(*it, _nFileCount);
- }// end else
- }// end if
- else
- {
- if(!m_pGconfClient->get_bool("/apps/wp_tray/b_img_check") || boost::regex_match(it->leaf(), m_regexImageCheck))
- {
- ++ _nFileCount;
- }// end if
- }// end else
- }// end try
- catch(const std::exception & ex)
- {
- std::cerr << "Wallpapers::CountEntriesInDirectory() : " << ex.what() << std::endl;
- }// end catch
- }// end for
-
- return _nFileCount;
-}// end Wallpapers::CountDirectoryEntries
-
+//------------------------------------------------------------------------
+std::size_t Wallpapers::CountDirectoryEntries
+(
+ fs::path _pathCurrent,
+ std::size_t & _nFileCount
+)
+{
+ fs::directory_iterator itEnd;
+
+ for(fs::directory_iterator it(_pathCurrent); it != itEnd; ++ it)
+ {
+ try
+ {
+ // is it a directory and not hidden?
+ if(fs::is_directory(*it) && it->leaf()[0] != '.')
+ {
+ if(fs::symbolic_link_exists(*it))
+ {
+ if(m_pGconfClient->get_bool("/apps/wp_tray/b_follow_links") == true)
+ {
+ // recurse
+ Wallpapers::CountDirectoryEntries(*it, _nFileCount);
+ }// end if
+ }// end if
+ else
+ {
+ // recurse
+ Wallpapers::CountDirectoryEntries(*it, _nFileCount);
+ }// end else
+ }// end if
+ else
+ {
+ if(!m_pGconfClient->get_bool("/apps/wp_tray/b_img_check") || boost::regex_match(it->leaf(), m_regexImageCheck))
+ {
+ ++ _nFileCount;
+ }// end if
+ }// end else
+ }// end try
+ catch(const std::exception & ex)
+ {
+ std::cerr << "Wallpapers::CountEntriesInDirectory() : " << ex.what() << std::endl;
+ }// end catch
+ }// end for
+
+ return _nFileCount;
+}// end Wallpapers::CountDirectoryEntries
+
//------------------------------------------------------------------------
/**
<Wallpapers::CountDirectoryEntries>
@brief Recursive method, treats all monitored folders as one, and finds the file at _nFileIndex.
-
- at param _pathCurrent Boost path giving the current directory/path in recursion.
- at param _nFileCount Number of files the algorithm has yet to pass.
+
+ at param _pathCurrent Boost path giving the current directory/path in recursion.
+ at param _nFileCount Number of files the algorithm has yet to pass.
@param _szFile An out parameter that gives the resulting file name.
@date 12-06-2006 GAF Written
**/
-//------------------------------------------------------------------------
-void Wallpapers::GetDirectoryEntryAtIndex
-(
- fs::path _pathCurrent,
- std::size_t & _nFileIndex,
- Glib::ustring & _szFile
-)
-{
- fs::directory_iterator itEnd;
-
- if(_nFileIndex == 0)
- {
- return;
- }// end if
-
- for(fs::directory_iterator it(_pathCurrent); it != itEnd && _nFileIndex != 0; ++ it)
- {
- try
- {
- if(fs::is_directory(*it))
- {
- if(fs::symbolic_link_exists(*it))
- {
- if(m_pGconfClient->get_bool("/apps/wp_tray/b_follow_links") == true)
- {
- // recurse
- Wallpapers::GetDirectoryEntryAtIndex(*it, _nFileIndex, _szFile);
- }// end if
- }// end if
- else
- {
- // recurse
- Wallpapers::GetDirectoryEntryAtIndex(*it, _nFileIndex, _szFile);
- }// end else
- }// end if
- else
- {
- if(!m_pGconfClient->get_bool("/apps/wp_tray/b_img_check") || boost::regex_match(it->leaf(), m_regexImageCheck))
- {
- if(-- _nFileIndex == 0)
- {
- _szFile = (*it).native_directory_string();
- }// end if
- }// end if
- }// end else
- }// end try
- catch(const std::exception & ex)
- {
- std::cerr << "Wallpapers::GetDirectoryEntryAtIndex() : " << it->leaf() << " " << ex.what() << std::endl;
- }// end catch
- }// end for
-}// end Wallpapers::GetDirectoryEntryAtIndex
-
+//------------------------------------------------------------------------
+void Wallpapers::GetDirectoryEntryAtIndex
+(
+ fs::path _pathCurrent,
+ std::size_t & _nFileIndex,
+ Glib::ustring & _szFile
+)
+{
+ fs::directory_iterator itEnd;
+
+ if(_nFileIndex == 0)
+ {
+ return;
+ }// end if
+
+ for(fs::directory_iterator it(_pathCurrent); it != itEnd && _nFileIndex != 0; ++ it)
+ {
+ try
+ {
+ if(fs::is_directory(*it))
+ {
+ if(fs::symbolic_link_exists(*it))
+ {
+ if(m_pGconfClient->get_bool("/apps/wp_tray/b_follow_links") == true)
+ {
+ // recurse
+ Wallpapers::GetDirectoryEntryAtIndex(*it, _nFileIndex, _szFile);
+ }// end if
+ }// end if
+ else
+ {
+ // recurse
+ Wallpapers::GetDirectoryEntryAtIndex(*it, _nFileIndex, _szFile);
+ }// end else
+ }// end if
+ else
+ {
+ if(!m_pGconfClient->get_bool("/apps/wp_tray/b_img_check") || boost::regex_match(it->leaf(), m_regexImageCheck))
+ {
+ if(-- _nFileIndex == 0)
+ {
+ _szFile = (*it).native_directory_string();
+ }// end if
+ }// end if
+ }// end else
+ }// end try
+ catch(const std::exception & ex)
+ {
+ std::cerr << "Wallpapers::GetDirectoryEntryAtIndex() : " << it->leaf() << " " << ex.what() << std::endl;
+ }// end catch
+ }// end for
+}// end Wallpapers::GetDirectoryEntryAtIndex
+
//------------------------------------------------------------------------
/**
<Wallpapers::CountStatics>
@brief Gives the number of useable wallpapers held by the Gnome Wallpaper tool.
-
+
@return The number of useable wallpapers held by the Gnome Wallpaper tool.
@date 12-06-2006 GAF Written
**/
-//------------------------------------------------------------------------
-std::size_t Wallpapers::CountStatics
-(
-)
-{
- // contentious, but opting here to rescan the xml for gnome wp list every time
- GnomeWPList gnomeWPList;
-
- return gnomeWPList.GetFileList().size();
-}// end Wallpapers::CountStatics
-
+//------------------------------------------------------------------------
+std::size_t Wallpapers::CountStatics
+(
+)
+{
+ // contentious, but opting here to rescan the xml for gnome wp list every time
+ GnomeWPList gnomeWPList;
+
+ return gnomeWPList.GetFileList().size();
+}// end Wallpapers::CountStatics
+
//------------------------------------------------------------------------
/**
<Wallpapers::CountStatics>
@brief Gives the number of useable wallpapers held by the Gnome Wallpaper tool.
-
+
@return The number of useable wallpapers held by the Gnome Wallpaper tool.
@date 12-06-2006 GAF Written
**/
-//------------------------------------------------------------------------
-std::string Wallpapers::GetStaticAtIndex
-(
- std::size_t _nFileIndex
-)
-{
- GnomeWPList gnomeWPList;
-
- const std::list<Glib::ustring> & reflsFileList = gnomeWPList.GetFileList();
-
- std::list<Glib::ustring>::const_iterator it = reflsFileList.begin();
-
- while(it != reflsFileList.end())
- {
- if(-- _nFileIndex == 0)
- {
- return *it;
- }// end if
-
- ++ it;
- }// end while
-
- return "";
-}// end Wallpapers::GetStaticAtIndex
-
+//------------------------------------------------------------------------
+std::string Wallpapers::GetStaticAtIndex
+(
+ std::size_t _nFileIndex
+)
+{
+ GnomeWPList gnomeWPList;
+
+ const std::list<Glib::ustring> & reflsFileList = gnomeWPList.GetFileList();
+
+ std::list<Glib::ustring>::const_iterator it = reflsFileList.begin();
+
+ while(it != reflsFileList.end())
+ {
+ if(-- _nFileIndex == 0)
+ {
+ return *it;
+ }// end if
+
+ ++ it;
+ }// end while
+
+ return "";
+}// end Wallpapers::GetStaticAtIndex
+
//------------------------------------------------------------------------
/**
<Wallpapers::RegenerateTimeout>
@brief Called when the user changes the wallpaper change timeout, to re-establish the glib callback.
-
- at param _nCnxn The connection id associated with the gconf key.
+
+ at param _nCnxn The connection id associated with the gconf key.
@param _gconfEntry The gconf entry that has changed.
@date 12-06-2006 GAF Written
**/
-//------------------------------------------------------------------------
-void Wallpapers::RegenerateTimeout
-(
- guint _nCnxn,
- Gnome::Conf::Entry _gconfEntry
-)
-{
- // delete old timeout!
- m_sigcConnection.disconnect();
-
- // (re)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
-}// end Wallpapers::regenerate_timeout
+//------------------------------------------------------------------------
+void Wallpapers::RegenerateTimeout
+(
+ guint _nCnxn,
+ Gnome::Conf::Entry _gconfEntry
+)
+{
+ // delete old timeout!
+ m_sigcConnection.disconnect();
+
+ // (re)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
+}// end Wallpapers::regenerate_timeout
--- wp_tray-0.5.3/src/PreferencesDialog.hh.orig 2007-05-08 23:36:48.000000000 +0200
+++ wp_tray-0.5.3/src/PreferencesDialog.hh 2007-05-08 23:34:37.000000000 +0200
@@ -6,16 +6,16 @@
* Dialog derivation that implements Wallpaper Tray preferences.
*
*-----------------------------------------------------------------------------
- */
-
-#include <gtkmm.h>
-#include <libglademm.h>
-#include <gconfmm-2.6/gconfmm.h>
-#include <list>
-
-#ifndef _PREFERENCES_DIALOG_GF_12112006
-#define _PREFERENCES_DIALOG_GF_12112006
-
+ */
+
+#include <gtkmm.h>
+#include <libglademm.h>
+#include <gconfmm-2.6/gconfmm.h>
+#include <list>
+
+#ifndef _PREFERENCES_DIALOG_GF_12112006
+#define _PREFERENCES_DIALOG_GF_12112006
+
//-----------------------------------------------------------------------------
/** @ingroup WPTray
@brief Defines the columns to be used in the preferences dialog tree model.
@@ -23,19 +23,19 @@
@author Gareth Foster
@date 05/09/2005
@remark Copyright(c) 2006 Gareth Foster.
-**/
-//-----------------------------------------------------------------------------
-class PreferencesDialogModelColumns : public Gtk::TreeModel::ColumnRecord
-{
- public:
- Gtk::TreeModelColumn<Glib::ustring> m_DirectoryName;
-
- PreferencesDialogModelColumns()
- {
- add(m_DirectoryName);
- }// end PreferencesDialogModelColumns
-};// end class PreferencesDialogModelColumns
-
+**/
+//-----------------------------------------------------------------------------
+class PreferencesDialogModelColumns : public Gtk::TreeModel::ColumnRecord
+{
+ public:
+ Gtk::TreeModelColumn<Glib::ustring> m_DirectoryName;
+
+ PreferencesDialogModelColumns()
+ {
+ add(m_DirectoryName);
+ }// end PreferencesDialogModelColumns
+};// end class PreferencesDialogModelColumns
+
//-----------------------------------------------------------------------------
/** @ingroup WPTray
@brief Dialog derivation that implements Wallpaper Tray preferences.
@@ -43,57 +43,59 @@
@author Gareth Foster
@date 05/09/2005
@remark Copyright(c) 2006 Gareth Foster.
-**/
-//-----------------------------------------------------------------------------
-class PreferencesDialog : public Gtk::Dialog
-{
-public:
- // public class interface
- PreferencesDialog(BaseObjectType * _pWindow, const Glib::RefPtr<Gnome::Glade::Xml> & _pGlade);
- virtual ~PreferencesDialog();
-
- void OnButtonCloseClick();
- void OnButtonApplyClick();
- void OnButtonAddDirClick();
- void OnButtonRemDirClick();
- void OnEntryTimeChanged();
-
-private:
- // private class interface
- void GetSettingsInGconf();
- void SetSettingsInGconf();
-
-private:
- // private class members
- const Glib::RefPtr<Gnome::Glade::Xml> m_pGlade;
- Glib::RefPtr<Gnome::Conf::Client> m_pGconfClient;
-
- Gtk::Button * m_pButtonClose;
- Gtk::Button * m_pButtonApply;
- Gtk::Button * m_pButtonAddDir;
- Gtk::Button * m_pButtonRemDir;
- Gtk::Entry * m_pEntryTime;
- Gtk::Entry * m_pEntryMode;
- Gtk::Entry * m_pEntrySelectionMode;
-
- Gtk::CheckButton * m_pCheckButtonTimeout;
- Gtk::CheckButton * m_pCheckButtonLogonNew;
- Gtk::CheckButton * m_pCheckButtonImageCheck;
- Gtk::CheckButton * m_pCheckButtonFollowLinks;
- Gtk::TreeView * m_pTreeView;
-
- PreferencesDialogModelColumns m_Model;
- Glib::RefPtr<Gtk::ListStore> m_pListstore;
-
- std::list<Glib::ustring> m_lsWpDir;
-
+**/
+//-----------------------------------------------------------------------------
+class PreferencesDialog : public Gtk::Dialog
+{
+public:
+ // public class interface
+ PreferencesDialog(BaseObjectType * _pWindow, const Glib::RefPtr<Gnome::Glade::Xml> & _pGlade);
+ virtual ~PreferencesDialog();
+
+ void OnButtonCloseClick();
+ void OnButtonApplyClick();
+ void OnButtonAddDirClick();
+ void OnButtonRemDirClick();
+ void OnEntryTimeChanged();
+
+private:
+ // private class interface
+ void GetSettingsInGconf();
+ void SetSettingsInGconf();
+
+private:
+ // private class members
+ const Glib::RefPtr<Gnome::Glade::Xml> m_pGlade;
+ Glib::RefPtr<Gnome::Conf::Client> m_pGconfClient;
+
+ Gtk::Button * m_pButtonClose;
+ Gtk::Button * m_pButtonApply;
+ Gtk::Button * m_pButtonAddDir;
+ Gtk::Button * m_pButtonRemDir;
+ Gtk::Entry * m_pEntryTime;
+ Gtk::Entry * m_pEntryMode;
+ Gtk::Entry * m_pEntrySelectionMode;
+
+ Gtk::CheckButton * m_pCheckButtonTimeout;
+ Gtk::CheckButton * m_pCheckButtonLogonNew;
+ Gtk::CheckButton * m_pCheckButtonImageCheck;
+ Gtk::CheckButton * m_pCheckButtonFollowLinks;
+ Gtk::CheckButton * m_pCheckButtonUseStatics;
+ Gtk::TreeView * m_pTreeView;
+
+ PreferencesDialogModelColumns m_Model;
+ Glib::RefPtr<Gtk::ListStore> m_pListstore;
+
+ std::list<Glib::ustring> m_lsWpDir;
+
int m_nTimeout;
bool m_bTimeout;
bool m_bWpLogon;
bool m_bImgCheck;
bool m_bFollowLinks;
- Glib::ustring m_szPictureOptions;
-
-};// end class PreferencesDialog
-
-#endif // _PREFERENCES_DIALOG_GF_12112006
+ bool m_bUseStatics;
+ Glib::ustring m_szPictureOptions;
+
+};// end class PreferencesDialog
+
+#endif // _PREFERENCES_DIALOG_GF_12112006
--- wp_tray-0.5.3/src/PreferencesDialog.cc.orig 2007-05-08 23:36:57.000000000 +0200
+++ wp_tray-0.5.3/src/PreferencesDialog.cc 2007-05-08 23:36:19.000000000 +0200
@@ -6,131 +6,134 @@
* Dialog derivation that implements Wallpaper Tray preferences.
*
*-----------------------------------------------------------------------------
- */
-
-#include "PreferencesDialog.hh"
-#include "config.h"
-#include <glib/gi18n.h>
-#include <stdexcept>
-#include <sstream>
-#include <algorithm>
-
+ */
+
+#include "PreferencesDialog.hh"
+#include "config.h"
+#include <glib/gi18n.h>
+#include <stdexcept>
+#include <sstream>
+#include <algorithm>
+
/** @defgroup WPTray WPTray
* WPTray contains classes used in the Wallpaper Tray program.
- */
-
+ */
+
//------------------------------------------------------------------------
/**
<PreferencesDialog::PreferencesDialog>
@brief Construct a new preferences dialog.
-
- at param _pWindow Required to allow this class to be instanciated from glade xml.
+
+ at param _pWindow Required to allow this class to be instanciated from glade xml.
@param _pGlade Required to allow this class to be instanciated from glade xml.
@date 12-11-2006 GAF Written
**/
-//------------------------------------------------------------------------
-PreferencesDialog::PreferencesDialog
-(
- BaseObjectType * _pWindow,
- const Glib::RefPtr<Gnome::Glade::Xml> & _pGlade
-) :
- 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)
-{
- // 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);
-
- // 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);
-
- // 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
-
-
+//------------------------------------------------------------------------
+PreferencesDialog::PreferencesDialog
+(
+ BaseObjectType * _pWindow,
+ const Glib::RefPtr<Gnome::Glade::Xml> & _pGlade
+) :
+ 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_pCheckButtonUseStatics(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_use_statics", m_pCheckButtonUseStatics);
+
+ // 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_pCheckButtonUseStatics->set_active(m_bUseStatics);
+
+ // 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
+
+
//------------------------------------------------------------------------
/**
<PreferencesDialog::~PreferencesDialog>
@@ -138,13 +141,13 @@
@date 12-11-2006 GAF Written
**/
-//------------------------------------------------------------------------
-PreferencesDialog::~PreferencesDialog
-(
-)
-{
-}// end PreferencesDialog::~PreferencesDialog
-
+//------------------------------------------------------------------------
+PreferencesDialog::~PreferencesDialog
+(
+)
+{
+}// end PreferencesDialog::~PreferencesDialog
+
//------------------------------------------------------------------------
/**
<PreferencesDialog::OnButtonCloseClick>
@@ -152,14 +155,14 @@
@date 12-11-2006 GAF Written
**/
-//------------------------------------------------------------------------
-void PreferencesDialog::OnButtonCloseClick
-(
-)
-{
- PreferencesDialog::hide();
-}// end PreferencesDialog::OnButtonCloseClick
-
+//------------------------------------------------------------------------
+void PreferencesDialog::OnButtonCloseClick
+(
+)
+{
+ PreferencesDialog::hide();
+}// end PreferencesDialog::OnButtonCloseClick
+
//------------------------------------------------------------------------
/**
<PreferencesDialog::OnButtonApplyClick>
@@ -167,16 +170,16 @@
@date 12-11-2006 GAF Written
**/
-//------------------------------------------------------------------------
-void PreferencesDialog::OnButtonApplyClick
-(
-)
-{
- PreferencesDialog::SetSettingsInGconf();
-
- PreferencesDialog::hide();
-}// end PreferencesDialog::OnButtonCloseClick
-
+//------------------------------------------------------------------------
+void PreferencesDialog::OnButtonApplyClick
+(
+)
+{
+ PreferencesDialog::SetSettingsInGconf();
+
+ PreferencesDialog::hide();
+}// end PreferencesDialog::OnButtonCloseClick
+
//------------------------------------------------------------------------
/**
<PreferencesDialog::OnButtonAddDirClick>
@@ -184,50 +187,50 @@
@date 12-11-2006 GAF Written
**/
-//------------------------------------------------------------------------
-void PreferencesDialog::OnButtonAddDirClick
-(
-)
-{
- Gtk::FileChooserDialog gtkFileChooserDialog(_("Wallpaper Tray - Please choose a folder"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER);
-
- gtkFileChooserDialog.set_transient_for(*this);
-
- // add response buttons the the dialog
- gtkFileChooserDialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
- gtkFileChooserDialog.add_button(_("Select"), Gtk::RESPONSE_OK);
-
- gtkFileChooserDialog.set_current_folder(Glib::get_home_dir());
-
- int n_Result = gtkFileChooserDialog.run();
-
- // handle the response
- switch(n_Result)
- {
- case(Gtk::RESPONSE_OK):
- {
- m_lsWpDir.push_back(gtkFileChooserDialog.get_filename());
-
- Gtk::TreeModel::iterator it_new = m_pListstore->append();
-
- (*it_new)[m_Model.m_DirectoryName] = gtkFileChooserDialog.get_filename();
- }// end case
- break;
-
- case(Gtk::RESPONSE_CANCEL):
- {
- // who cares?
- }// end case
- break;
-
- default:
- {
- // gah, i dunno, throw something?
- }// end default
- break;
- }// end switch
-}// end PreferencesDialog::OnButtonAddDirClick
-
+//------------------------------------------------------------------------
+void PreferencesDialog::OnButtonAddDirClick
+(
+)
+{
+ Gtk::FileChooserDialog gtkFileChooserDialog(_("Wallpaper Tray - Please choose a folder"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER);
+
+ gtkFileChooserDialog.set_transient_for(*this);
+
+ // add response buttons the the dialog
+ gtkFileChooserDialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
+ gtkFileChooserDialog.add_button(_("Select"), Gtk::RESPONSE_OK);
+
+ gtkFileChooserDialog.set_current_folder(Glib::get_home_dir());
+
+ int n_Result = gtkFileChooserDialog.run();
+
+ // handle the response
+ switch(n_Result)
+ {
+ case(Gtk::RESPONSE_OK):
+ {
+ m_lsWpDir.push_back(gtkFileChooserDialog.get_filename());
+
+ Gtk::TreeModel::iterator it_new = m_pListstore->append();
+
+ (*it_new)[m_Model.m_DirectoryName] = gtkFileChooserDialog.get_filename();
+ }// end case
+ break;
+
+ case(Gtk::RESPONSE_CANCEL):
+ {
+ // who cares?
+ }// end case
+ break;
+
+ default:
+ {
+ // gah, i dunno, throw something?
+ }// end default
+ break;
+ }// end switch
+}// end PreferencesDialog::OnButtonAddDirClick
+
//------------------------------------------------------------------------
/**
<PreferencesDialog::OnButtonRemDirClick>
@@ -235,28 +238,28 @@
@date 12-11-2006 GAF Written
**/
-//------------------------------------------------------------------------
-void PreferencesDialog::OnButtonRemDirClick
-(
-)
-{
- Glib::RefPtr<Gtk::TreeSelection> pTreeSelection = m_pTreeView->get_selection();
-
- Gtk::TreeModel::iterator it = pTreeSelection->get_selected();
-
- // if anything is selected
- if(it)
- {
- Glib::ustring szValue;
-
- it->get_value(0, szValue);
-
- m_lsWpDir.erase(std::find(m_lsWpDir.begin(), m_lsWpDir.end(), szValue));
-
- m_pListstore->erase(it);
- }// end if
-}// end PreferencesDialog::OnButtonRemDirClick
-
+//------------------------------------------------------------------------
+void PreferencesDialog::OnButtonRemDirClick
+(
+)
+{
+ Glib::RefPtr<Gtk::TreeSelection> pTreeSelection = m_pTreeView->get_selection();
+
+ Gtk::TreeModel::iterator it = pTreeSelection->get_selected();
+
+ // if anything is selected
+ if(it)
+ {
+ Glib::ustring szValue;
+
+ it->get_value(0, szValue);
+
+ m_lsWpDir.erase(std::find(m_lsWpDir.begin(), m_lsWpDir.end(), szValue));
+
+ m_pListstore->erase(it);
+ }// end if
+}// end PreferencesDialog::OnButtonRemDirClick
+
//------------------------------------------------------------------------
/**
<PreferencesDialog::GetSettingsInGconf>
@@ -264,10 +267,10 @@
@date 12-11-2006 GAF Written
**/
-//------------------------------------------------------------------------
-void PreferencesDialog::GetSettingsInGconf
-(
-)
+//------------------------------------------------------------------------
+void PreferencesDialog::GetSettingsInGconf
+(
+)
{
m_lsWpDir = m_pGconfClient->get_string_list("/apps/wp_tray/dir_list");
m_nTimeout = m_pGconfClient->get_int("/apps/wp_tray/n_timeout");
@@ -275,10 +278,11 @@
m_bWpLogon = m_pGconfClient->get_bool("/apps/wp_tray/b_wp_logon");
m_bImgCheck = m_pGconfClient->get_bool("/apps/wp_tray/b_img_check");
m_bFollowLinks = m_pGconfClient->get_bool("/apps/wp_tray/b_follow_links");
- m_szPictureOptions = m_pGconfClient->get_string("/desktop/gnome/background/picture_options");
-}// end PreferencesDialog::GetSettingsInGconf
-
-
+ m_bUseStatics = m_pGconfClient->get_bool("/apps/wp_tray/b_use_statics");
+ m_szPictureOptions = m_pGconfClient->get_string("/desktop/gnome/background/picture_options");
+}// end PreferencesDialog::GetSettingsInGconf
+
+
//------------------------------------------------------------------------
/**
<PreferencesDialog::SetSettingsInGconf>
@@ -286,24 +290,25 @@
@date 12-11-2006 GAF Written
**/
-//------------------------------------------------------------------------
-void PreferencesDialog::SetSettingsInGconf
-(
-)
-{
- // mwahaha scum bag C coders, we have overloading!
- m_pGconfClient->set_string_list("/apps/wp_tray/dir_list", m_lsWpDir);
-
- // set the other widgets up from the gconf values
- std::stringstream ss;
- ss.imbue(std::locale("")); // use the user's locale for this stream
- ss << m_pEntryTime->get_text().c_str();
- ss >> m_nTimeout;
+//------------------------------------------------------------------------
+void PreferencesDialog::SetSettingsInGconf
+(
+)
+{
+ // mwahaha scum bag C coders, we have overloading!
+ m_pGconfClient->set_string_list("/apps/wp_tray/dir_list", m_lsWpDir);
+
+ // set the other widgets up from the gconf values
+ std::stringstream ss;
+ ss.imbue(std::locale("")); // use the user's locale for this stream
+ ss << m_pEntryTime->get_text().c_str();
+ ss >> m_nTimeout;
m_pGconfClient->set("/apps/wp_tray/n_timeout", m_nTimeout);
m_pGconfClient->set("/apps/wp_tray/b_timeout", m_pCheckButtonTimeout->get_active());
m_pGconfClient->set("/apps/wp_tray/b_wp_logon", m_pCheckButtonLogonNew->get_active());
m_pGconfClient->set("/apps/wp_tray/b_img_check", m_pCheckButtonImageCheck->get_active());
m_pGconfClient->set("/apps/wp_tray/b_follow_links", m_pCheckButtonFollowLinks->get_active());
- m_pGconfClient->set("/desktop/gnome/background/picture_options", m_pEntryMode->get_text());
-}// end PreferencesDialog::SetSettingsToGconf
+ m_pGconfClient->set("/apps/wp_tray/b_use_statics", m_pCheckButtonUseStatics->get_active());
+ m_pGconfClient->set("/desktop/gnome/background/picture_options", m_pEntryMode->get_text());
+}// end PreferencesDialog::SetSettingsToGconf
--- wp_tray-0.5.3/wp_tray.schemas.orig 2007-05-08 22:36:05.000000000 +0200
+++ wp_tray-0.5.3/wp_tray.schemas 2007-05-08 23:19:14.000000000 +0200
@@ -14,6 +14,19 @@
</locale>
</schema>
<schema>
+ <key>/schemas/apps/wp_tray/b_use_statics</key>
+ <applyto>/apps/wp_tray/b_use_statics</applyto>
+ <owner>wp_tray</owner>
+ <type>bool</type>
+ <default>false</default>
+ <locale name="C">
+ <short>Use Gnome Wallpapers</short>
+ <long>
+ Whether or not to add the standard Gnome wallpapers to the list.
+ </long>
+ </locale>
+ </schema>
+ <schema>
<key>/schemas/apps/wp_tray/b_img_check</key>
<applyto>/apps/wp_tray/b_img_check</applyto>
<owner>wp_tray</owner>
Index: wp_tray.spec
===================================================================
RCS file: /cvs/pkgs/rpms/wp_tray/devel/wp_tray.spec,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- wp_tray.spec 8 Dec 2006 17:45:30 -0000 1.7
+++ wp_tray.spec 8 May 2007 21:57:34 -0000 1.8
@@ -1,12 +1,13 @@
Name: wp_tray
Version: 0.5.3
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: A wallpaper-changing applet for GNOME
Group: Amusements/Graphics
License: GPL
URL: http://planetearthworm.com/projects/wp_tray/
Source0: http://planetearthworm.com/projects/wp_tray/files/%{name}-%{version}.tar.gz
+Patch0: wp_tray-0.5.3-gnomewp.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: gettext libglademm24-devel libgnomecanvasmm26-devel
@@ -19,6 +20,7 @@
%prep
%setup -q
+%patch0 -p1 -b .gnomewp
%build
%configure --with-boostfilesystem=%{_libdir}/libboost_filesystem.so \
@@ -63,6 +65,9 @@
%{_sysconfdir}/gconf/schemas/*.schemas
%changelog
+* Tue May 8 2007 Denis Leroy <denis at poolshark.org> - 0.5.3-3
+- Added patch to make gnome wp addition optional, minor glade fixes
+
* Fri Dec 8 2006 Denis Leroy <denis at poolshark.org> - 0.5.3
- Update to 0.5.3, patches integrated upstream
- Added libxml++ and libnotify dependencies
- Previous message (by thread): rpms/php-pear-HTML-QuickForm-ElementGrid/devel .cvsignore, 1.2, 1.3 php-pear-HTML-QuickForm-ElementGrid.spec, 1.1, 1.2 sources, 1.2, 1.3
- Next message (by thread): rpms/rosegarden4/FC-6 rosegarden-1.5.1-desktop-file.patch, NONE, 1.1 rosegarden-1.5.1-lib64.patch, NONE, 1.1 .cvsignore, 1.3, 1.4 rosegarden4.spec, 1.4, 1.5 sources, 1.3, 1.4 rosegarden-4-1.2.3-lib64.patch, 1.1, NONE rosegarden-4-desktop-file.patch, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list