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

void PreferencesDialog::OnButtonAddDirClick (  ) 

Handle the users request to add a new wallpaper directory.

<PreferencesDialog::OnButtonAddDirClick>

Date:
12-11-2006 GAF Written

Definition at line 192 of file PreferencesDialog.cc.

Referenced by PreferencesDialog().

{
      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


Generated by  Doxygen 1.6.0   Back to index