void VentanaCliente::initVentanas() {
    get_widget_derived(V_DINAMICA, pVDinamica);
    get_widget_derived(AUTENTIF_ADMIN, pDAutentifAdmin);
    get_widget_derived(CONFIG_ADMIN, pVAdminConfig);
    get_widget(ACERCA_DE, pDAbout);

    pVDinamica->signal_actualizacion().connect(sigc::mem_fun(*this,
            &VentanaCliente::on_actualizacion_solicitada));
}
Exemplo n.º 2
0
void GtkRSSDialog::feedAdd()
{
	auto refBuilder = Gtk::Builder::create();
	refBuilder->add_from_resource("/org/gtk/gtorrent/dialog_generic.ui");
	GtkGenericAddDialog *addFilterDialog = nullptr;
	refBuilder->get_widget_derived("genericDialog", addFilterDialog);
	addFilterDialog->set_transient_for(*this);
	addFilterDialog->set_default_response(1);
	addFilterDialog->set_title("Add Feed");
	addFilterDialog->label1->set_text("Feed Name:");
	addFilterDialog->label2->set_text("Feed URL:");

	if(addFilterDialog->run() == 1)
	{
		if(addFilterDialog->entry1->get_text() != "" && addFilterDialog->entry2->get_text() != "")
		{
			Gtk::TreeRow row = *storeGlobalFeeds->append();
			std::shared_ptr<gt::Feed> f = m_core->addFeed(addFilterDialog->entry2->get_text());
			row[col_globals.name] = addFilterDialog->entry1->get_text();
			row[col_globals.feed] = f;
			row[col_globals.feed_url] = f->settings().url;
			f->owners.insert(m_feedgroups);
		}
	}
	delete addFilterDialog;
}
Exemplo n.º 3
0
void GtkRSSDialog::functionAdd()
{
	// you can add a function only if the the filter specified in the lhs exists
	// if the specified filter doesn't exist, the user should warned, and if he
	// wants to proceed, a "New Filter" dialog will be shown before adding the function
	if(m_feedgroups->filters.empty()) {
		auto errorDial = std::make_shared<Gtk::MessageDialog>("You need to add filters in order to add functions !");
		errorDial->run();
		return;
	}

	auto refBuilder = Gtk::Builder::create();
	refBuilder->add_from_resource("/org/gtk/gtorrent/dialog_function.ui");
	GtkFunctionDialog *addFunctionDialog = nullptr;
	refBuilder->get_widget_derived("functiondialog", addFunctionDialog);
	addFunctionDialog->set_transient_for(*this);
	addFunctionDialog->set_default_response(1);
	addFunctionDialog->set_title("Function");
	addFunctionDialog->setFeedGroup(m_feedgroups);

	if(addFunctionDialog->run() == 1) {
		Gtk::TreeRow row = *storeFunctions->append();
		std::string fun = addFunctionDialog->filter->get_active_text();
		int op = addFunctionDialog->filter->get_active_row_number();
		std::string ops = "<>=!";
		fun += " " + ops[op] + ' ';
		fun += addFunctionDialog->constant->get_text();
		m_feedgroups->functions.insert(fun);
		row[functions.eval] = fun;
	}
	delete addFunctionDialog;
}
Exemplo n.º 4
0
void GtkRSSDialog::filterAdd()
{
	// filters are run on every items from every active feed
	// Filter have uniques names, but can have same regexes
	auto refBuilder = Gtk::Builder::create();
	refBuilder->add_from_resource("/org/gtk/gtorrent/dialog_generic.ui");
	GtkGenericAddDialog *addFilterDialog = nullptr;
	refBuilder->get_widget_derived("genericDialog", addFilterDialog);
	addFilterDialog->set_transient_for(*this);
	addFilterDialog->set_default_response(1);
	addFilterDialog->set_title("Add Filter");
	addFilterDialog->label1->set_text("Filter Name:");
	addFilterDialog->label2->set_text("Filter Regex:");
	if(addFilterDialog->run() == 1)
	{
		if(addFilterDialog->entry1->get_text() != "" && addFilterDialog->entry2->get_text() != "")
		{
			Gtk::TreeRow row = *storeFilters->append();
			m_feedgroups->filters[addFilterDialog->entry1->get_text()] = addFilterDialog->entry2->get_text();
			row[filters.name] = addFilterDialog->entry1->get_text();
			row[filters.regex] = addFilterDialog->entry2->get_text();
		}
	}
	delete addFilterDialog;
}
void TabAdminConfigConsultas::initTabConfig() {
    get_widget(ENTRY_TAB_LABEL, pEntryTabLabel);
    get_widget_derived(VBOX_TAB_CONFIG, pTabVista);

    Gtk::HBox* pHBoxTabSelec;
    get_widget(HBOX_TAB_SELEC, pHBoxTabSelec);
    pHBoxTabSelec->pack_start(comboTabSelec, false, false);
    comboTabSelec.show();
}
MainScreenController::MainScreenController(Context *context) : Controller(context), view(nullptr) {
  auto refBuilder = Gtk::Builder::create();

  try {
    refBuilder->add_from_file(PATH_HOME_SCREEN_LAYOUT);
  } catch(const Glib::FileError& ex) {
    return;
  } catch(const Glib::MarkupError& ex) {
    return;
  } catch(const Gtk::BuilderError& ex) {
    return;
  }

  refBuilder->get_widget_derived(PATH_HOME_SCREEN_ROOT_VIEW, view);

  view->setEnterPressedListener(this);
}