📄 settings.cpp
字号:
Gtk::SHRINK, standard_size/4, standard_size/2); attach(popup_help_button, 2, 3, 3, 4, Gtk::SHRINK, Gtk::SHRINK, standard_size/4, standard_size/2); attach(filler2, 1, 2, 4, 5, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); command_help_button.signal_clicked().connect(sigc::bind(sigc::mem_fun(*this, &PrintTable::show_help), static_cast<int>(PrintMessages::command))); shrink_help_button.signal_clicked().connect(sigc::bind(sigc::mem_fun(*this, &PrintTable::show_help), static_cast<int>(PrintMessages::shrink))); popup_help_button.signal_clicked().connect(sigc::bind(sigc::mem_fun(*this, &PrintTable::show_help), static_cast<int>(PrintMessages::popup))); tooltips.set_tip(command_help_button, help_messages.get_message(PrintMessages::command)); tooltips.set_tip(shrink_help_button, help_messages.get_message(PrintMessages::shrink)); tooltips.set_tip(popup_help_button, help_messages.get_message(PrintMessages::popup)); set_border_width(standard_size/3);}Glib::ustring PrintTable::get_popup(void) const { if (popup_button.get_active()) return Glib::ustring("Yes");; return Glib::ustring("No");}void PrintTable::set_popup(const Glib::ustring& popup_string) { std::string temp(popup_string.lowercase()); if (!temp.compare("no")) popup_button.set_active(false); else popup_button.set_active(true);}void PrintTable::show_help(int message_index) { show_help_sig(help_messages.get_message(message_index), help_messages.get_caption(message_index));}void PrintTable::clear(void) { command_entry.set_text(""); shrink_entry.set_text("");}ViewTable::ViewTable(const int standard_size): Gtk::Table(3, 3, false), ps_view_command_label(gettext("Postscript Viewer\nProgram:")) { ps_view_command_label.set_justify(Gtk::JUSTIFY_LEFT); ps_view_command_entry.set_size_request(standard_size * 7, standard_size); Gtk::Image* image_p = manage(new Gtk::Image(Gdk::Pixbuf::create_from_xpm_data(help_xpm))); ps_view_command_help_button.add(*image_p); attach(filler1, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); attach(ps_view_command_label, 0, 1, 1, 2, Gtk::SHRINK, Gtk::SHRINK, standard_size/3, standard_size); attach(ps_view_command_entry, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, standard_size/3, standard_size); attach(ps_view_command_help_button, 2, 3, 1, 2, Gtk::SHRINK, Gtk::SHRINK, standard_size/3, standard_size); attach(filler2, 1, 2, 2, 3, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); ps_view_command_help_button.signal_clicked().connect(sigc::bind(sigc::mem_fun(*this, &ViewTable::show_help), static_cast<int>(ViewMessages::ps_view_command))); tooltips.set_tip(ps_view_command_help_button, help_messages.get_message(ViewMessages::ps_view_command)); set_border_width(standard_size/3);}void ViewTable::show_help(int message_index) { show_help_sig(help_messages.get_message(message_index), help_messages.get_caption(message_index));}void ViewTable::clear(void) { ps_view_command_entry.set_text("");}SockTable::SockTable(const int standard_size): Gtk::Table(6, 3, false), run_server_label(gettext("Run socket server")), popup_label(gettext("Popup dialog when fax\nreceived from socket")), port_label(gettext("Port to which faxes to\nbe sent:")), client_address_label(gettext("Addresses allowed to\nconnect")), localhost_button(gettext("localhost ")), other_address_button(gettext("other")), run_server_box(false, 2), popup_box(false, 2), client_address_box(false, 2) { other_addresses_entry.set_editable(false); other_addresses_entry.set_sensitive(false); run_server_label.set_justify(Gtk::JUSTIFY_RIGHT); popup_label.set_justify(Gtk::JUSTIFY_RIGHT); port_label.set_justify(Gtk::JUSTIFY_RIGHT); client_address_label.set_justify(Gtk::JUSTIFY_RIGHT); port_entry.set_size_request(standard_size * 7, standard_size); run_server_box.pack_start(run_server_button, false, false, 0); run_server_box.pack_start(run_server_box_filler, true, false, 0); popup_box.pack_start(popup_button, false, false, 0); popup_box.pack_start(popup_box_filler, true, false, 0); Gtk::RadioButton::Group client_address_group(other_address_button.get_group()); localhost_button.set_group(client_address_group); localhost_button.set_active(true); client_address_box.pack_start(localhost_button, false, false, 0); client_address_box.pack_start(other_address_button, false, false, 0); client_address_box.pack_start(client_address_box_filler, true, false, 0); client_address_frame_box.pack_start(client_address_box, false, false, 0); client_address_frame_box.pack_start(other_addresses_entry, false, false, 0); client_address_frame_box.set_border_width(4); client_address_frame.add(client_address_frame_box); Glib::RefPtr<Gdk::Pixbuf> pixbuf_r(Gdk::Pixbuf::create_from_xpm_data(help_xpm)); Gtk::Image* image_p = manage(new Gtk::Image(pixbuf_r)); run_server_help_button.add(*image_p); image_p = manage(new Gtk::Image(pixbuf_r)); popup_help_button.add(*image_p); image_p = manage(new Gtk::Image(pixbuf_r)); port_help_button.add(*image_p); image_p = manage(new Gtk::Image(pixbuf_r)); client_address_help_button.add(*image_p); attach(filler1, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); attach(run_server_label, 0, 1, 1, 2, Gtk::SHRINK, Gtk::SHRINK, standard_size/4, standard_size/3); attach(run_server_box, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, standard_size/4, standard_size/3); attach(run_server_help_button, 2, 3, 1, 2, Gtk::SHRINK, Gtk::SHRINK, standard_size/4, standard_size/3); attach(popup_label, 0, 1, 2, 3, Gtk::SHRINK, Gtk::SHRINK, standard_size/4, standard_size/3); attach(popup_box, 1, 2, 2, 3, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, standard_size/4, standard_size/3); attach(popup_help_button, 2, 3, 2, 3, Gtk::SHRINK, Gtk::SHRINK, standard_size/4, standard_size/3); attach(port_label, 0, 1, 3, 4, Gtk::SHRINK, Gtk::SHRINK, standard_size/4, standard_size/3); attach(port_entry, 1, 2, 3, 4, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, standard_size/4, standard_size/3); attach(port_help_button, 2, 3, 3, 4, Gtk::SHRINK, Gtk::SHRINK, standard_size/4, standard_size/3); attach(client_address_label, 0, 1, 4, 5, Gtk::SHRINK, Gtk::SHRINK, standard_size/4, standard_size/3); attach(client_address_frame, 1, 2, 4, 5, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, standard_size/4, standard_size/3); attach(client_address_help_button, 2, 3, 4, 5, Gtk::SHRINK, Gtk::SHRINK, standard_size/4, standard_size/3); attach(filler2, 1, 2, 5, 6, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); other_address_button.signal_clicked().connect(sigc::mem_fun(*this, &SockTable::other_address_button_toggled_slot)); run_server_help_button.signal_clicked().connect(sigc::bind(sigc::mem_fun(*this, &SockTable::show_help), static_cast<int>(SockMessages::run_server))); popup_help_button.signal_clicked().connect(sigc::bind(sigc::mem_fun(*this, &SockTable::show_help), static_cast<int>(SockMessages::popup))); port_help_button.signal_clicked().connect(sigc::bind(sigc::mem_fun(*this, &SockTable::show_help), static_cast<int>(SockMessages::port))); client_address_help_button.signal_clicked().connect(sigc::bind(sigc::mem_fun(*this, &SockTable::show_help), static_cast<int>(SockMessages::client_address))); tooltips.set_tip(run_server_help_button, help_messages.get_message(SockMessages::run_server)); tooltips.set_tip(popup_help_button, help_messages.get_message(SockMessages::popup)); tooltips.set_tip(port_help_button, help_messages.get_message(SockMessages::port)); tooltips.set_tip(client_address_help_button, help_messages.get_message(SockMessages::client_address)); set_border_width(standard_size/3);}Glib::ustring SockTable::get_run_server(void) const { if (run_server_button.get_active()) return Glib::ustring("Yes"); return Glib::ustring("No");}Glib::ustring SockTable::get_popup(void) const { if (popup_button.get_active()) return Glib::ustring("Yes");; return Glib::ustring("No");}Glib::ustring SockTable::get_if_other_address(void) const { if (other_address_button.get_active()) return Glib::ustring("other");; return Glib::ustring("localhost");}void SockTable::set_run_server(const Glib::ustring& run_server_string) { std::string temp(run_server_string.lowercase()); if (!temp.compare("yes")) run_server_button.set_active(true); else run_server_button.set_active(false);}void SockTable::set_popup(const Glib::ustring& popup_string) { std::string temp(popup_string.lowercase()); if (!temp.compare("yes")) popup_button.set_active(true); else popup_button.set_active(false);}void SockTable::set_if_other_address(const Glib::ustring& if_other_address_string) { std::string temp(if_other_address_string.lowercase()); if (!temp.compare("other")) other_address_button.set_active(true); else localhost_button.set_active(true);}void SockTable::show_help(int message_index) { show_help_sig(help_messages.get_message(message_index), help_messages.get_caption(message_index));}void SockTable::clear(void) { run_server_button.set_active(false); popup_button.set_active(false); other_address_button.set_active(false); port_entry.set_text(""); other_addresses_entry.set_text("");}void SockTable::other_address_button_toggled_slot(void) { if (other_address_button.get_active()) { other_addresses_entry.set_editable(true); other_addresses_entry.set_sensitive(true); } else { other_addresses_entry.set_editable(false); other_addresses_entry.set_sensitive(false); }}ReceiveTable::ReceiveTable(const int standard_size): Gtk::Table(4, 3, false), popup_label(gettext("Popup dialog when fax\nreceived by modem")), exec_label(gettext("Execute a program or script\nwhen fax received by modem")), popup_box(false, 2), exec_box(false, 2) { prog_entry.set_editable(false); prog_entry.set_sensitive(false); prog_entry.set_size_request(standard_size * 7, standard_size); popup_label.set_justify(Gtk::JUSTIFY_RIGHT); exec_label.set_justify(Gtk::JUSTIFY_RIGHT); popup_box.pack_start(popup_button, false, false, 0); popup_box.pack_start(popup_box_filler, true, false, 0); exec_box.pack_start(exec_button, false, false, 0); exec_box.pack_start(exec_box_filler, true, false, 0); exec_frame_box.pack_start(exec_box, false, false, 0); exec_frame_box.pack_start(prog_entry, false, false, 0); exec_frame_box.set_border_width(4); exec_frame.add(exec_frame_box); Glib::RefPtr<Gdk::Pixbuf> pixbuf_r(Gdk::Pixbuf::create_from_xpm_data(help_xpm)); Gtk::Image* image_p = manage(new Gtk::Image(pixbuf_r)); popup_help_button.add(*image_p); image_p = manage(new Gtk::Image(pixbuf_r)); exec_help_button.add(*image_p); attach(filler1, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); attach(popup_label, 0, 1, 1, 2, Gtk::SHRINK, Gtk::SHRINK, standard_size/3, standard_size); attach(popup_box, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, standard_size/3, standard_size); attach(popup_help_button, 2, 3, 1, 2, Gtk::SHRINK, Gtk::SHRINK, standard_size/3, standard_size); attach(exec_label, 0, 1, 2, 3, Gtk::SHRINK, Gtk::SHRINK, standard_size/3, standard_size); attach(exec_frame, 1, 2, 2, 3, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, standard_size/3, standard_size); attach(exec_help_button, 2, 3, 2, 3, Gtk::SHRINK, Gtk::SHRINK, standard_size/3, standard_size); attach(filler2, 1, 2, 3, 4, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); exec_button.signal_clicked().connect(sigc::mem_fun(*this, &ReceiveTable::exec_button_toggled_slot)); popup_help_button.signal_clicked().connect(sigc::bind(sigc::mem_fun(*this, &ReceiveTable::show_help), static_cast<int>(ReceiveMessages::popup))); exec_help_button.signal_clicked().connect(sigc::bind(sigc::mem_fun(*this, &ReceiveTable::show_help), static_cast<int>(ReceiveMessages::exec))); tooltips.set_tip(popup_help_button, help_messages.get_message(ReceiveMessages::popup)); tooltips.set_tip(exec_help_button, help_messages.get_message(ReceiveMessages::exec)); set_border_width(standard_size/3);}Glib::ustring ReceiveTable::get_popup(void) const { if (popup_button.get_active()) return Glib::ustring("Yes");; return Glib::ustring("No");}Glib::ustring ReceiveTable::get_exec(void) const { if (exec_button.get_active()) return Glib::ustring("Yes");; return Glib::ustring("No");}void ReceiveTable::set_popup(const Glib::ustring& popup_string) { std::string temp(popup_string.lowercase()); if (!temp.compare("yes")) popup_button.set_active(true); else popup_button.set_active(false);}void ReceiveTable::set_exec(const Glib::ustring& exec_string) { std::string temp(exec_string.lowercase()); if (!temp.compare("yes")) exec_button.set_active(true); else exec_button.set_active(false);}void ReceiveTable::show_help(int message_index) { show_help_sig(help_messages.get_message(message_index), help_messages.get_caption(message_index));}void ReceiveTable::clear(void) { popup_button.set_active(false); exec_button.set_active(false); prog_entry.set_text("");}void ReceiveTable::exec_button_toggled_slot(void) { if (exec_button.get_active()) { prog_entry.set_editable(true); prog_entry.set_sensitive(true); } else { prog_entry.set_editable(false); prog_entry.set_sensitive(false); }}LoggingTable::LoggingTable(const int standard_size): Gtk::Table(3, 3, false), logfile_label(gettext("Log File: ")) { logfile_label.set_justify(Gtk::JUSTIFY_RIGHT); logfile_entry.set_size_request(standard_size * 7, standard_size); Gtk::Image* image_p = manage(new Gtk::Image(Gdk::Pixbuf::create_from_xpm_data(help_xpm))); logfile_help_button.add(*image_p); attach(filler1, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); attach(logfile_label, 0, 1, 1, 2, Gtk::SHRINK, Gtk::SHRINK, standard_size/3, standard_size); attach(logfile_entry, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, standard_size/3, standard_size);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -