示例#1
0
/** \brief  Create a label for the description */
Gtk::Widget *
ParamDescription::get_widget (SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal<void> * /*changeSignal*/)
{
	if (_gui_hidden) {
        return NULL;
    }

    Glib::ustring newguitext;

    if (_context != NULL) {
        newguitext = g_dpgettext2(NULL, _context, _value);
    } else {
        newguitext = _(_value);
    }
    
    Gtk::Label * label;
    int padding = 12 + _indent;
    if (_mode == HEADER) {
        label = Gtk::manage(new Gtk::Label(Glib::ustring("<b>") +newguitext + Glib::ustring("</b>"), Gtk::ALIGN_START));
        label->set_padding(0,5);
        label->set_use_markup(true);
        padding = _indent;
    } else {
        label = Gtk::manage(new Gtk::Label(newguitext, Gtk::ALIGN_START));
    }
    label->set_line_wrap();
    label->show();

    Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4));
    hbox->pack_start(*label, true, true, padding);
    hbox->show();

    return hbox;
}
示例#2
0
SelectDialog::SelectDialog
(
   ButtonID    buttons,
   const char* title,
   const char* message,
   bool        needSelection

)
 : DialogBox(buttons, title)
 , sw_(0)
 , list_(0)
 , selectBtn_(0)
 , deselectBtn_(0)
 , needSelection_(needSelection)
{
    get_vbox()->set_border_width(2);
    if (message)
    {
       Gtk::Box* hbox = manage(new Gtk::HBox);
       get_vbox()->pack_start(*hbox, false, false);

       Gtk::Frame* frame = manage(new Gtk::Frame);
       hbox->pack_start(*frame);
       hbox->set_border_width(3);

       Gtk::Label* label = manage(new Gtk::Label(message, .0));
       frame->add(*label);

       label->set_padding(3, 5);
       Gtk_set_size(label, 570, -1);
       label->set_justify(Gtk_FLAG(JUSTIFY_LEFT));
       label->set_line_wrap(true);
    }
    sw_ = manage(new Gtk::ScrolledWindow);
    get_vbox()->pack_start(*sw_);

    sw_->set_policy(Gtk_FLAG(POLICY_AUTOMATIC), Gtk_FLAG(POLICY_AUTOMATIC));
    Gtk_set_size(sw_, 580, 300);

    list_ = manage(new Gtk::List);
    Gtk_add_with_viewport(sw_, *list_);
    list_->set_selection_mode(Gtk_FLAG(SELECTION_MULTIPLE));

    add_select_button("Select _All", true);
    add_select_button("_Deselect All", false);

    Gtk_set_resizable(this, true);

    if (needSelection)
    {
       if (Gtk::Button* btn = get_ok_button())
       {
           btn->set_sensitive(false);
       }
    }
    selConn_ = Gtk_CONNECT_0(list_, selection_changed,
      this, &SelectDialog::on_selection_changed);

    get_vbox()->show_all();
}
示例#3
0
		void set_path(const Raul::Path& path) {
			remove();
			const char* text = (path.is_root()) ? "/" : path.symbol();
			Gtk::Label* lab = manage(new Gtk::Label(text));
			lab->set_padding(0, 0);
			lab->show();
			add(*lab);

			if (_view && _view->graph()->path() != path)
				_view.reset();
		}
    BuilderFrame()
    {
        set_shadow_type(Gtk::SHADOW_ETCHED_IN);
        set_border_width(5);

        m_Label = Gtk::manage(new Gtk::Label());
        m_Label->set_padding(3, 0);
        m_Label->set_visible(true);

        set_label_widget(*m_Label);
    }
MapViewAddLayersDialog::MapViewAddLayersDialog()
{
  mp_Dialog = new Gtk::Dialog(_("Displaying resources in MapView"));

  mref_TreeModel = Gtk::ListStore::create(m_Columns);

  mp_TreeView = Gtk::manage(new Gtk::TreeView(mref_TreeModel));

  mp_TreeView->append_column(_("Data type"), m_Columns.m_Type);
  mp_TreeView->get_column(0)->set_sort_column(m_Columns.m_Type);

  mp_TreeView->append_column(_("Data ID"), m_Columns.m_Id);
  mp_TreeView->get_column(1)->set_sort_column(m_Columns.m_Id);

  mp_TreeView->append_column(_("Unit Class"), m_Columns.m_Class);
  mp_TreeView->get_column(2)->set_sort_column(m_Columns.m_Class);

  mp_TreeView->append_column(_("Data source path"), m_Columns.m_Path);
  mp_TreeView->get_column(3)->set_sort_column(m_Columns.m_Path);

  mp_TreeView->get_selection()->set_mode(Gtk::SELECTION_MULTIPLE);

  mp_TreeView->expand_all();

  mp_ScrolledWin = Gtk::manage(new Gtk::ScrolledWindow());
  mp_ScrolledWin->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
  mp_ScrolledWin->add(*mp_TreeView);

  Gtk::Frame* MainFrame = Gtk::manage(new Gtk::Frame());
  MainFrame->set_shadow_type(Gtk::SHADOW_IN);
  MainFrame->set_border_width(5);
  MainFrame->set_visible(true);
  MainFrame->add(*mp_ScrolledWin);

  Gtk::Label* TheLabel = Gtk::manage(new Gtk::Label(
      _("Choose resources to display:"), 0, 0.5));
  TheLabel->set_padding(0,5);

  mp_Dialog->get_vbox()->pack_start(*TheLabel, Gtk::PACK_SHRINK);
  mp_Dialog->get_vbox()->pack_start(*MainFrame);

  mp_Dialog->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
  mp_Dialog->add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);

  mp_Dialog->set_default_response(Gtk::RESPONSE_OK);

  mp_Dialog->set_default_size(500, 300);

  mp_Dialog->show_all_children();
}
示例#6
0
DateFilter::DateFilter() {

	m_startdate.clear();
	m_enddate.clear();
	set_spacing(12);

	// filtertype button
	m_filter_type = manage(new Gtk::ComboBoxText);
	m_filter_type->append_text(gettext("None"));
	m_filter_type->append_text(gettext("Today"));
	m_filter_type->append_text(gettext("Yesterday"));
	m_filter_type->append_text(gettext("Date"));
	m_filter_type->append_text(gettext("Range"));
	m_filter_type->set_active_text(gettext("None"));
	m_filter_type->signal_changed().connect(sigc::mem_fun(*this, &DateFilter::on_filtertype_changed));
	m_filter_type->show();

	// date selection
	m_filter_date = manage(new Gtk::HBox);

	m_filter_popup_from = manage(new Gtk::Button);
	m_filter_popup_from->signal_clicked().connect(sigc::bind(sigc::mem_fun(*this, &DateFilter::on_select_date), true));
	m_filter_popup_from->show();

	m_filter_date->pack_start(*m_filter_popup_from, Gtk::PACK_SHRINK);

	// date range
	m_filter_range = manage(new Gtk::HBox);

	m_filter_popup_to = manage(new Gtk::Button);
	m_filter_popup_to->signal_clicked().connect(sigc::bind(sigc::mem_fun(*this, &DateFilter::on_select_date), false));
	m_filter_popup_to->show();

	Gtk::Label* label = manage(new Gtk::Label("-"));
	label->set_padding(12,0);
	label->show();
	m_filter_range->pack_start(*label, Gtk::PACK_SHRINK);
	m_filter_range->pack_start(*m_filter_popup_to, Gtk::PACK_SHRINK);

	// container for date/range selection
	Gtk::HBox* type_container = manage(new Gtk::HBox);
	type_container->pack_start(*m_filter_date, Gtk::PACK_SHRINK);
	type_container->pack_start(*m_filter_range, Gtk::PACK_SHRINK);
	type_container->show();

	// add all widgets
	pack_start(*m_filter_type, Gtk::PACK_SHRINK);
	pack_start(*type_container, Gtk::PACK_SHRINK);
}
示例#7
0
         limitDialog::limitDialog(const char * _szUploadLabel, const char * _szDownloadLabel, const char * _szParam3Label, const char * _szParam4Label)
            : Gtk::Dialog(GPD->sGUI_CLIENT() + " " + GPD->sFULLVERSION() + " / Limit", true /* modal */, true /* use_separator aka set_has_separator() */ ),
              limit_interval(5),
              limit_selected(false),
              selected_upload_disable(false),
              selected_download_disable(false),
              selected_param3_disable(false),
              selected_param4_disable(false),
              uploadCombo(0),
              downloadCombo(0),
              param3Spin(0),
              param4Spin(0),
              selected_upload_limit(-1),
              selected_download_limit(-1)
         {
            Gtk::Label *uploadLabel   = Gtk::manage(new class Gtk::Label( _szUploadLabel ? _szUploadLabel : "Upload" ));
            Gtk::Label *downloadLabel = Gtk::manage(new class Gtk::Label( _szDownloadLabel ? _szDownloadLabel : "Download" ));
            uploadCombo               = Gtk::manage(new class Gtk::ComboBoxText());
            downloadCombo             = Gtk::manage(new class Gtk::ComboBoxText());

            Gtk::Label *seedPercentLabel = Gtk::manage(new class Gtk::Label( _szParam3Label ? _szParam3Label : "Seed %" ));
            Gtk::Label *seedTimeLabel    = Gtk::manage(new class Gtk::Label( _szParam4Label ? _szParam4Label : "Seed Time" ));

            Gtk::Adjustment *seedPercentAdjustment = Gtk::manage(new class Gtk::Adjustment(1, 0, 100, 1, 10, 10));
            param3Spin = Gtk::manage(new class Gtk::SpinButton(*seedPercentAdjustment, 1, 0));

            Gtk::Adjustment *seedTimeAdjustment = Gtk::manage(new class Gtk::Adjustment(1, 0, 100, 1, 10, 10));
            param4Spin    = Gtk::manage(new class Gtk::SpinButton(*seedTimeAdjustment, 1, 0));

            Gtk::Table *settingsTable = Gtk::manage(new class Gtk::Table(4, 2, false));
            Gtk::VBox *limitVbox      = Gtk::manage(new class Gtk::VBox(false, 10));

            uploadLabel->set_alignment(0,0.5);
            uploadLabel->set_padding(5,0);
            uploadLabel->set_justify(Gtk::JUSTIFY_LEFT);
            uploadLabel->set_line_wrap(false);
            uploadLabel->set_use_markup(false);
            uploadLabel->set_selectable(false);

            downloadLabel->set_alignment(0,0.5);
            downloadLabel->set_padding(5,0);
            downloadLabel->set_justify(Gtk::JUSTIFY_LEFT);
            downloadLabel->set_line_wrap(false);
            downloadLabel->set_use_markup(false);
            downloadLabel->set_selectable(false);

            seedPercentLabel->set_alignment(0,0.5);
            seedPercentLabel->set_padding(5,0);
            seedPercentLabel->set_justify(Gtk::JUSTIFY_LEFT);
            seedPercentLabel->set_line_wrap(false);
            seedPercentLabel->set_use_markup(false);
            seedPercentLabel->set_selectable(false);

            seedTimeLabel->set_alignment(0,0.5);
            seedTimeLabel->set_padding(5,0);
            seedTimeLabel->set_justify(Gtk::JUSTIFY_LEFT);
            seedTimeLabel->set_line_wrap(false);
            seedTimeLabel->set_use_markup(false);
            seedTimeLabel->set_selectable(false);

            param3Spin->set_flags(Gtk::CAN_FOCUS);
            param3Spin->set_update_policy(Gtk::UPDATE_ALWAYS);
            param3Spin->set_numeric(false);
            param3Spin->set_digits(0);
            param3Spin->set_wrap(false);
            param3Spin->set_range(0, MaxParam3Value);

            param4Spin->set_flags(Gtk::CAN_FOCUS);
            param4Spin->set_update_policy(Gtk::UPDATE_ALWAYS);
            param4Spin->set_numeric(false);
            param4Spin->set_digits(0);
            param4Spin->set_wrap(false);
            param4Spin->set_range(0, MaxParam4Value);

            uploadCombo->append_text("disable");
            downloadCombo->append_text("disable");

            for (t_int i=limit_interval; i<=200; i+=limit_interval)
               {
                  using namespace btg::core;
                  std::string s = convertToString<int>(i) + " KiB/sec";
                  uploadCombo->append_text(s);
                  downloadCombo->append_text(s);
               }

            uploadCombo->set_active(0);
            downloadCombo->set_active(0);

            settingsTable->set_border_width(10);
            settingsTable->set_row_spacings(20);
            settingsTable->set_col_spacings(5);

            /* */
            settingsTable->attach(*uploadLabel, 0, 1, 0, 1, Gtk::FILL, Gtk::AttachOptions(), 0, 0);
            settingsTable->attach(*downloadLabel, 0, 1, 1, 2, Gtk::FILL, Gtk::AttachOptions(), 0, 0);
            settingsTable->attach(*seedPercentLabel, 0, 1, 2, 3, Gtk::FILL, Gtk::AttachOptions(), 0, 0);
            settingsTable->attach(*seedTimeLabel, 0, 1, 3, 4, Gtk::FILL, Gtk::AttachOptions(), 0, 0);

            settingsTable->attach(*param3Spin, 1, 2, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::AttachOptions(), 0, 0);
            settingsTable->attach(*param4Spin,    1, 2, 3, 4, Gtk::EXPAND|Gtk::FILL, Gtk::AttachOptions(), 0, 0);

            settingsTable->attach(*uploadCombo, 1, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::AttachOptions(), 0, 0);
            settingsTable->attach(*downloadCombo, 1, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::AttachOptions(), 0, 0);

            limitVbox->pack_start(*settingsTable, Gtk::PACK_SHRINK, 0);

            property_window_position().set_value(Gtk::WIN_POS_CENTER);
            set_resizable(true);
            property_destroy_with_parent().set_value(false);

            get_vbox()->pack_start(*limitVbox);

            set_default_size(300, 200);

            // Create buttons and connect their signals.
            add_button("Set", 1);
            add_button("Cancel", 2);
            signal_response().connect(sigc::mem_fun(*this, &limitDialog::on_button_pressed));
            
            show_all(); // flag all inner elements as visible
            hide(); // hide toplevel window
         }
         sessionSelectionDialog::sessionSelectionDialog(std::string const& _title,
                                                        t_longList const& _sessionIDs, 
                                                        t_strList const& _sessionsNames,
                                                        bool const _disableSelection)
            : disableSelection_(_disableSelection),
              selected(false),
              session(Command::INVALID_SESSION),
              cbt(0)
         {
            Gtk::Button* cancelbutton = Gtk::manage(new class Gtk::Button(Gtk::StockID("gtk-cancel")));
            Gtk::Button* okbutton     = Gtk::manage(new class Gtk::Button(Gtk::StockID("gtk-ok")));
            Gtk::Label* label = Gtk::manage(new class Gtk::Label(_title));

            cbt                   = Gtk::manage(new class Gtk::ComboBoxText());
            Gtk::VBox* vbox       = Gtk::manage(new class Gtk::VBox(false, 0));

            cancelbutton->set_flags(Gtk::CAN_FOCUS);
            cancelbutton->set_relief(Gtk::RELIEF_NORMAL);
            okbutton->set_flags(Gtk::CAN_FOCUS);
            okbutton->set_relief(Gtk::RELIEF_NORMAL);
            get_action_area()->property_layout_style().set_value(Gtk::BUTTONBOX_END);
            label->set_alignment(0.5,0.5);
            label->set_padding(0,0);
            label->set_justify(Gtk::JUSTIFY_LEFT);
            label->set_line_wrap(false);
            label->set_use_markup(false);
            label->set_selectable(false);

            vbox->pack_start(*label, Gtk::PACK_SHRINK, 0);
            vbox->pack_start(*cbt);
            get_vbox()->set_homogeneous(false);
            get_vbox()->set_spacing(0);
            get_vbox()->pack_start(*vbox);

            set_title(_title);
            set_modal(true);
            property_window_position().set_value(Gtk::WIN_POS_NONE);
            set_resizable(true);
            property_destroy_with_parent().set_value(false);
            set_has_separator(true);
            add_action_widget(*cancelbutton, -6);
            add_action_widget(*okbutton, -5);

            /// Fill the combobox with session ids.
            t_strListCI sessionNameIter = _sessionsNames.begin();
            for (t_longListCI sessionIter = _sessionIDs.begin();
                 sessionIter != _sessionIDs.end();
                 sessionIter++)
               {
                  std::string session_descr = convertToString<t_long>(*sessionIter);
                  session_descr += " (";
                  session_descr += *sessionNameIter;
                  session_descr += ")";

                  cbt->append_text(session_descr);
                  sessionNameIter++;
               }

            // Select the first session id.
            cbt->set_active(0);

            if (!disableSelection_)
               {
                  cancelbutton->show();
               }

            okbutton->show();
            label->show();
            cbt->show();
            vbox->show();
            show();

            // Connect buttons to handlers.
            okbutton->signal_clicked().connect(sigc::mem_fun(*this, &sessionSelectionDialog::on_ok_clicked));
            if (!disableSelection_)
               {
                  cancelbutton->signal_clicked().connect(sigc::mem_fun(*this, &sessionSelectionDialog::on_cancel_clicked));
               }
         }
示例#9
0
         aboutDialog::aboutDialog()
         {
            Gtk::Dialog *ad = this;

            Gtk::Button *okbutton    = Gtk::manage(new class Gtk::Button("ok"));
            Gtk::Label *aboutLabel   = Gtk::manage(new class Gtk::Label( "About " + GPD->sGUI_CLIENT() + " " + GPD->sVERSION() + ", build " + GPD->sBUILD() ));
            Gtk::TextView *textview  = Gtk::manage(new class Gtk::TextView());
            Gtk::ScrolledWindow *scrolledwindow = Gtk::manage(new class Gtk::ScrolledWindow());
            Gtk::VBox *vbox                     = Gtk::manage(new class Gtk::VBox(false, 0));

            okbutton->set_flags(Gtk::CAN_FOCUS);
            okbutton->set_relief(Gtk::RELIEF_NORMAL);

            ad->get_action_area()->property_layout_style().set_value(Gtk::BUTTONBOX_END);
            ad->set_default_size(300, 200);

            aboutLabel->set_alignment(0.5,0.5);
            aboutLabel->set_padding(0,0);
            aboutLabel->set_justify(Gtk::JUSTIFY_LEFT);
            aboutLabel->set_line_wrap(false);
            aboutLabel->set_use_markup(false);
            aboutLabel->set_selectable(false);

            textview->set_flags(Gtk::CAN_FOCUS);
            textview->set_editable(true);
            textview->set_cursor_visible(true);
            textview->set_pixels_above_lines(0);
            textview->set_pixels_below_lines(0);
            textview->set_pixels_inside_wrap(0);
            textview->set_left_margin(0);
            textview->set_right_margin(0);
            textview->set_indent(0);
            textview->set_wrap_mode(Gtk::WRAP_NONE);
            textview->set_justification(Gtk::JUSTIFY_LEFT);

            using namespace std;
            string text;
            text += "btg Copyright (C) 2005 Michael Wojciechowski.";
            text += GPD->sNEWLINE();
            text += "This program is free software; you can redistribute it and/or modify";
            text += GPD->sNEWLINE();
            text += "it under the terms of the GNU General Public License as published by ";
            text += GPD->sNEWLINE();
            text += "the Free Software Foundation; either version 2 of the License, or ";
            text += GPD->sNEWLINE();
            text += "(at your option) any later version.";
            text += GPD->sNEWLINE();
            text += "This program is distributed in the hope that it will be useful, ";
            text += GPD->sNEWLINE();
            text += "but WITHOUT ANY WARRANTY; without even the implied warranty of ";
            text += GPD->sNEWLINE();
            text += "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the ";
            text += GPD->sNEWLINE();
            text += "GNU General Public License for more details.";
            text += GPD->sNEWLINE();
            text += "You should have received a copy of the GNU General Public License ";
            text += GPD->sNEWLINE();
            text += "along with this program; if not, write to the Free Software ";
            text += GPD->sNEWLINE();
            text += "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA";
            text += GPD->sNEWLINE();

            textview->get_buffer()->set_text(text);

            scrolledwindow->set_flags(Gtk::CAN_FOCUS);
            scrolledwindow->set_shadow_type(Gtk::SHADOW_IN);
            scrolledwindow->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
            scrolledwindow->property_window_placement().set_value(Gtk::CORNER_TOP_LEFT);
            scrolledwindow->add(*textview);
            vbox->pack_start(*aboutLabel, Gtk::PACK_SHRINK, 0);
            vbox->pack_start(*scrolledwindow);
            ad->get_vbox()->set_homogeneous(false);
            ad->get_vbox()->set_spacing(0);
            ad->get_vbox()->pack_start(*vbox);
            //ad->set_title( "About " + GPD->sGUI_CLIENT() + " " + GPD->sVERSION() );
            ad->set_title( GPD->sGUI_CLIENT() + " " + GPD->sVERSION() + " / About" );
            ad->set_modal(true);
            ad->property_window_position().set_value(Gtk::WIN_POS_CENTER);
            ad->set_resizable(true);
            ad->property_destroy_with_parent().set_value(false);
            ad->set_has_separator(true);
            ad->add_action_widget(*okbutton, -5);
            okbutton->show();
            aboutLabel->show();
            textview->show();
            scrolledwindow->show();
            vbox->show();

            okbutton->signal_clicked().connect(sigc::mem_fun(*this, &aboutDialog::on_ok_clicked));
            // ad->show();
         }
示例#10
0
         preferencesDialog::preferencesDialog(int const _min_port, int const _max_port)
            : portrange_begin(0),
              beginPortRangeSpinbuttonAdj(0),
              portrange_end(0),
              endPortRangeSpinbuttonAdj(0),
              workPathEntry(0),
              outputPathEntry(0),
              leechModeCheckbutton(0),
              min_port(_max_port), max_port(_min_port),
              workPath(),
              outputPath(),
              leechmode(false),
              portrange_begin_intial_value(0),
              portrange_end_intial_value(0),
              workPath_initial_value(""),
              outputPath_initial_value(""),
              leechmode_initial_value(false),
              portrange_begin_signal(),
              portrange_end_signal(),
              save_btn_pressed(false)
         {
            Gtk::Label* workLabel      = Gtk::manage(new class Gtk::Label("Working directory"));
            Gtk::Label* outputLabel    = Gtk::manage(new class Gtk::Label("Output directory"));
            Gtk::Label* portRangeLabel = Gtk::manage(new class Gtk::Label("Port range"));
            Gtk::Label* leechModeLabel = Gtk::manage(new class Gtk::Label("Leech mode"));
            outputPathEntry            = Gtk::manage(new class Gtk::Entry());

            workPathEntry              = Gtk::manage(new class Gtk::Entry());

            leechModeCheckbutton       = Gtk::manage(new class Gtk::CheckButton("enabled"));
            Gtk::Table* settingsTable  = Gtk::manage(new class Gtk::Table(2, 2, false));

            // Ports:
            Gtk::Table* portTable       = Gtk::manage(new class Gtk::Table(2, 2, false));;
            Gtk::Label* beginPortLabel  = Gtk::manage(new class Gtk::Label("Begin Port"));
            Gtk::Label* endPortLabel    = Gtk::manage(new class Gtk::Label("End Port"));
            beginPortRangeSpinbuttonAdj = Gtk::manage(new class Gtk::Adjustment(_min_port, _min_port, _max_port, 1, 100, 10));
            portrange_begin             = Gtk::manage(new class Gtk::SpinButton(*beginPortRangeSpinbuttonAdj, 1, 0));
            endPortRangeSpinbuttonAdj   = Gtk::manage(new class Gtk::Adjustment(_min_port, _min_port, _max_port, 1, 100, 10));
            portrange_end               = Gtk::manage(new class Gtk::SpinButton(*endPortRangeSpinbuttonAdj, 1, 0));

            beginPortLabel->set_alignment(0,0.5);
            beginPortLabel->set_padding(5,5);
            beginPortLabel->set_justify(Gtk::JUSTIFY_LEFT);
            beginPortLabel->set_line_wrap(false);
            beginPortLabel->set_use_markup(false);
            beginPortLabel->set_selectable(false);

            endPortLabel->set_alignment(0,0.5);
            endPortLabel->set_padding(5,5);
            endPortLabel->set_justify(Gtk::JUSTIFY_LEFT);
            endPortLabel->set_line_wrap(false);
            endPortLabel->set_use_markup(false);
            endPortLabel->set_selectable(false);

            portrange_end->set_flags(Gtk::CAN_FOCUS);
            portrange_end->set_update_policy(Gtk::UPDATE_ALWAYS);
            portrange_end->set_numeric(false);
            portrange_end->set_digits(0);
            portrange_end->set_wrap(false);
            portrange_end->set_flags(Gtk::CAN_FOCUS);
            portrange_end->set_update_policy(Gtk::UPDATE_ALWAYS);
            portrange_end->set_numeric(true);
            portrange_end->set_digits(0);
            portrange_end->set_wrap(false);

            portrange_begin->set_flags(Gtk::CAN_FOCUS);
            portrange_begin->set_update_policy(Gtk::UPDATE_ALWAYS);
            portrange_begin->set_numeric(false);
            portrange_begin->set_digits(0);
            portrange_begin->set_wrap(false);
            portrange_begin->set_flags(Gtk::CAN_FOCUS);
            portrange_begin->set_update_policy(Gtk::UPDATE_ALWAYS);
            portrange_begin->set_numeric(true);
            portrange_begin->set_digits(0);
            portrange_begin->set_wrap(false);

            portTable->set_border_width(10);
            portTable->set_row_spacings(5);
            portTable->set_col_spacings(5);
            portTable->attach(*beginPortLabel, 0, 1, 0, 1, Gtk::FILL, Gtk::AttachOptions(), 0, 0);
            portTable->attach(*endPortLabel, 0, 1, 1, 2, Gtk::FILL, Gtk::AttachOptions(), 0, 0);
            portTable->attach(*portrange_end, 1, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::AttachOptions(), 0, 0);
            portTable->attach(*portrange_begin, 1, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::AttachOptions(), 0, 0);

            beginPortLabel->show();
            endPortLabel->show();
            portrange_begin->show();
            portrange_end->show();
            portTable->show();

            Gtk::VBox *preferencesVbox = Gtk::manage(new class Gtk::VBox(false, 10));

            outputLabel->set_alignment(0,0.5);
            outputLabel->set_padding(5,0);
            outputLabel->set_justify(Gtk::JUSTIFY_LEFT);
            outputLabel->set_line_wrap(false);
            outputLabel->set_use_markup(false);
            outputLabel->set_selectable(false);

            workLabel->set_alignment(0,0.5);
            workLabel->set_padding(5,0);
            workLabel->set_justify(Gtk::JUSTIFY_LEFT);
            workLabel->set_line_wrap(false);
            workLabel->set_use_markup(false);
            workLabel->set_selectable(false);



            portRangeLabel->set_alignment(0,0.5);
            portRangeLabel->set_padding(5,0);
            portRangeLabel->set_justify(Gtk::JUSTIFY_LEFT);
            portRangeLabel->set_line_wrap(false);
            portRangeLabel->set_use_markup(false);
            portRangeLabel->set_selectable(false);

            leechModeLabel->set_alignment(0,0.5);
            leechModeLabel->set_padding(5,0);
            leechModeLabel->set_justify(Gtk::JUSTIFY_LEFT);
            leechModeLabel->set_line_wrap(false);
            leechModeLabel->set_use_markup(false);
            leechModeLabel->set_selectable(false);

            Gtk::HBox* pathHbox     = Gtk::manage(new class Gtk::HBox(false, 10));
            Gtk::HBox* workPathHbox = Gtk::manage(new class Gtk::HBox(false, 10));

            outputPathEntry->set_flags(Gtk::CAN_FOCUS);
            outputPathEntry->set_visibility(true);
            outputPathEntry->set_editable(false);
            outputPathEntry->set_max_length(0);
            outputPathEntry->set_text("");
            outputPathEntry->set_has_frame(true);
            outputPathEntry->set_activates_default(false);

            workPathEntry->set_flags(Gtk::CAN_FOCUS);
            workPathEntry->set_visibility(true);
            workPathEntry->set_editable(false);
            workPathEntry->set_max_length(0);
            workPathEntry->set_text("");
            workPathEntry->set_has_frame(true);
            workPathEntry->set_activates_default(false);

            Gtk::Button* pathButton = Gtk::manage(new class Gtk::Button("Change Path"));
            Gtk::Button* workPathButton = Gtk::manage(new class Gtk::Button("Change Path"));

            pathHbox->pack_start(*outputPathEntry);
            pathHbox->pack_start(*pathButton, Gtk::PACK_SHRINK, 0);

            workPathHbox->pack_start(*workPathEntry);
            workPathHbox->pack_start(*workPathButton, Gtk::PACK_SHRINK, 0);

            leechModeCheckbutton->set_flags(Gtk::CAN_FOCUS);
            leechModeCheckbutton->set_relief(Gtk::RELIEF_NORMAL);
            leechModeCheckbutton->set_mode(true);
            leechModeCheckbutton->set_active(false);

            settingsTable->set_border_width(10);
            settingsTable->set_row_spacings(20);
            settingsTable->set_col_spacings(5);

            // left rigth top bottom

            /*
              table1->attach(*label1, 0, 1, 0, 1, Gtk::FILL, Gtk::AttachOptions(), 0, 0);
              table1->attach(*label2, 0, 1, 1, 2, Gtk::FILL, Gtk::AttachOptions(), 0, 0);
              table1->attach(*label3, 0, 1, 2, 3, Gtk::FILL, Gtk::AttachOptions(), 0, 0);
              table1->attach(*label4, 0, 1, 3, 4, Gtk::FILL, Gtk::AttachOptions(), 0, 0);
              table1->attach(*entry1, 1, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::AttachOptions(), 0, 0);
              table1->attach(*entry2, 1, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::AttachOptions(), 0, 0);
              table1->attach(*entry3, 1, 2, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::AttachOptions(), 0, 0);
              table1->attach(*entry4, 1, 2, 3, 4, Gtk::EXPAND|Gtk::FILL, Gtk::AttachOptions(), 0, 0);
            */

            settingsTable->attach(*workLabel,            0, 1, 0, 1, Gtk::FILL, Gtk::AttachOptions(), 0, 0);
            settingsTable->attach(*outputLabel,          0, 1, 1, 2, Gtk::FILL, Gtk::AttachOptions(), 0, 0);
            settingsTable->attach(*portRangeLabel,       0, 1, 2, 3, Gtk::FILL, Gtk::AttachOptions(), 0, 0);
            settingsTable->attach(*leechModeLabel,       0, 1, 3, 4, Gtk::FILL, Gtk::AttachOptions(), 0, 0);
            settingsTable->attach(*workPathHbox,         1, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::AttachOptions(), 0, 0);
            settingsTable->attach(*pathHbox,             1, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::AttachOptions(), 0, 0);
            settingsTable->attach(*portTable,            1, 2, 2, 3, Gtk::FILL, Gtk::FILL, 0, 0);
            settingsTable->attach(*leechModeCheckbutton, 1, 2, 3, 4, Gtk::FILL, Gtk::AttachOptions(), 0, 0);

            preferencesVbox->pack_start(*settingsTable, Gtk::PACK_SHRINK, 0);

            set_title( GPD->sGUI_CLIENT() + " " + GPD->sFULLVERSION() + " / Preferences" );
            set_modal(true);
            property_window_position().set_value(Gtk::WIN_POS_CENTER);
            set_resizable(true);
            property_destroy_with_parent().set_value(false);
            set_has_separator(true);

            get_vbox()->pack_start(*preferencesVbox);

            set_default_size(300, 200);

            outputLabel->show();
            workLabel->show();
            portRangeLabel->show();
            leechModeLabel->show();
            outputPathEntry->show();
            pathButton->show();
            pathHbox->show();

            workPathEntry->show();
            workPathButton->show();
            workPathHbox->show();

            leechModeCheckbutton->show();
            settingsTable->show();

            preferencesVbox->show();

            // Create buttons and connect their signals.
            add_button("Save", 1);
            add_button("Cancel", 2);

            signal_response().connect(sigc::mem_fun(*this, &preferencesDialog::on_dialog_button_pressed));

            pathButton->signal_clicked().connect(sigc::mem_fun(*this, &preferencesDialog::on_path_select_button_pressed));

            workPathButton->signal_clicked().connect(sigc::mem_fun(*this, &preferencesDialog::on_work_path_select_button_pressed));

            get_vbox()->show();
         }