void print_status(const int debuglvl) { int max_height = 0, max_width = 0, height = 0, width = 0, startx = 0, starty = 0; /* get screensize */ getmaxyx(stdscr, max_height, max_width); width = 72; height = max_height - 6; startx = (max_width - width) / 2; starty = 3; /* should not happen */ if(VuurmuurStatus.StatusList.len == 0) { (void)read_helpline(debuglvl, &VuurmuurStatus.StatusList, gettext("No problems were detected in the current setup.\n")); } set_lines(debuglvl, &VuurmuurStatus.StatusList, (size_t)(width - 4)); /* print the status list */ print_list(debuglvl, &VuurmuurStatus.StatusList, gettext("Status"), height, width, starty, startx, UTF8_FALSE); }
void print_help(const int debuglvl, char *part) { struct vrmr_list HelpList; int max_height = 0, max_width = 0, height = 0, width = 0, startx = 0, starty = 0; #ifdef USE_WIDEC wchar_t wpart[32] = L""; #endif /* USE_WIDEC */ /* get screensize */ getmaxyx(stdscr, max_height, max_width); width = 72; height = max_height - 6; startx = max_width - width - 5; starty = 3; #ifdef USE_WIDEC if(utf8_mode == FALSE) { #endif /* USE_WIDEC */ /* read the helpfile */ if(read_helpfile(debuglvl, &HelpList, part) < 0) return; set_lines(debuglvl, &HelpList, (size_t)(width - 4)); print_list(debuglvl, &HelpList, gettext("Help"), height, width, starty, startx, UTF8_FALSE); vrmr_list_cleanup(debuglvl, &HelpList); #ifdef USE_WIDEC } else { /* convert the part name to a wchar_t string */ mbstowcs(wpart, part, wsizeof(wpart)); if(debuglvl >= LOW) vrmr_debug(__FUNC__, "part: %s, wpart %ls, %u", part, wpart, wsizeof(wpart)); /* read the helpfile */ if(read_wide_helpfile(debuglvl, &HelpList, wpart) < 0) return; set_wide_lines(debuglvl, &HelpList, width - 4); print_list(debuglvl, &HelpList, gettext("Help"), height, width, starty, startx, UTF8_TRUE); vrmr_list_cleanup(debuglvl, &HelpList); } #endif /* USE_WIDEC */ }
void print_about(const int debuglvl) { int max_height = 0, max_width = 0, height = 0, width = 0, startx = 0, starty = 0; struct vrmr_list about_list; /* top menu */ char *key_choices[] = { "F10" }; int key_choices_n = 1; char *cmd_choices[] = { gettext("back") }; int cmd_choices_n = 1; char about_version_string[sizeof(version_string)]; /* create the about version string */ snprintf(about_version_string, sizeof(about_version_string), "Version: %s\n", version_string); /* get screensize */ getmaxyx(stdscr, max_height, max_width); width = 72; height = max_height - 8; startx = (max_width - width) / 2; starty = 4; vrmr_list_setup(debuglvl, &about_list, free_helpword); (void)read_helpline(debuglvl, &about_list, "Vuurmuur_conf\n"); (void)read_helpline(debuglvl, &about_list, "\n"); (void)read_helpline(debuglvl, &about_list, "=============\n"); (void)read_helpline(debuglvl, &about_list, "\n"); (void)read_helpline(debuglvl, &about_list, about_version_string); (void)read_helpline(debuglvl, &about_list, "\n"); (void)read_helpline(debuglvl, &about_list, "\n"); (void)read_helpline(debuglvl, &about_list, "Copyright 2003-2007 (c) Victor Julien <victor(at)vuurmuur(dot)org>.\n"); (void)read_helpline(debuglvl, &about_list, "This program is distributed under the terms of the GPL.\n"); (void)read_helpline(debuglvl, &about_list, "\n"); (void)read_helpline(debuglvl, &about_list, "Support\n"); (void)read_helpline(debuglvl, &about_list, "\n"); (void)read_helpline(debuglvl, &about_list, "=======\n"); (void)read_helpline(debuglvl, &about_list, "\n"); (void)read_helpline(debuglvl, &about_list, "\n"); (void)read_helpline(debuglvl, &about_list, "Website: http://www.vuurmuur.org/\n"); (void)read_helpline(debuglvl, &about_list, "\n"); (void)read_helpline(debuglvl, &about_list, "Mailinglist: http://sourceforge.net/mail/?group_id=114382\n"); (void)read_helpline(debuglvl, &about_list, "\n"); (void)read_helpline(debuglvl, &about_list, "Forum: http://sourceforge.net/forum/?group_id=114382\n"); (void)read_helpline(debuglvl, &about_list, "\n"); (void)read_helpline(debuglvl, &about_list, "IRC: irc://irc.freenode.net/vuurmuur\n"); (void)read_helpline(debuglvl, &about_list, "\n"); (void)read_helpline(debuglvl, &about_list, "\n"); (void)read_helpline(debuglvl, &about_list, "Thanks to\n"); (void)read_helpline(debuglvl, &about_list, "\n"); (void)read_helpline(debuglvl, &about_list, "=========\n"); (void)read_helpline(debuglvl, &about_list, "\n"); (void)read_helpline(debuglvl, &about_list, "\n"); (void)read_helpline(debuglvl, &about_list, "Philippe Baumgart (documentation).\n"); (void)read_helpline(debuglvl, &about_list, "Michiel Bodewes (website development).\n"); (void)read_helpline(debuglvl, &about_list, "Nicolas Dejardin <zephura(at)free(dot)fr> (French translation).\n"); (void)read_helpline(debuglvl, &about_list, "Adi Kriegisch (coding, documentation, Debian packages).\n"); (void)read_helpline(debuglvl, &about_list, "Sebastian Marten (documentation).\n"); (void)read_helpline(debuglvl, &about_list, "Holger Ohmacht (German translation).\n"); (void)read_helpline(debuglvl, &about_list, "Hugo Ribeiro (Brazilian Portuguese translation).\n"); (void)read_helpline(debuglvl, &about_list, "Aleksandr Shubnik <alshu(at)tut(dot)by> (rpm development, Russian translation).\n"); (void)read_helpline(debuglvl, &about_list, "Per Olav Siggerud (Norwegian translation).\n"); (void)read_helpline(debuglvl, &about_list, "Alexandre Simon (coding).\n"); (void)read_helpline(debuglvl, &about_list, "Stefan Ubbink (Gentoo ebuilds, coding).\n"); (void)read_helpline(debuglvl, &about_list, "Rob de Wit (wiki hosting).\n"); (void)read_helpline(debuglvl, &about_list, "\n"); (void)read_helpline(debuglvl, &about_list, "See: http://www.vuurmuur.org/trac/wiki/Credits for the latest information.\n"); (void)read_helpline(debuglvl, &about_list, "\n"); set_lines(debuglvl, &about_list, (size_t)(width - 4)); draw_top_menu(debuglvl, top_win, gettext("About"), key_choices_n, key_choices, cmd_choices_n, cmd_choices); /* print the status list */ print_list(debuglvl, &about_list, gettext("About"), height, width, starty, startx, UTF8_FALSE); vrmr_list_cleanup(debuglvl, &about_list); }
void mc_skin_hardcoded_space_lines (mc_skin_t * mc_skin) { /* single lines */ set_lines ("vert", " "); set_lines ("horiz", " "); set_lines ("lefttop", " "); set_lines ("righttop", " "); set_lines ("leftbottom", " "); set_lines ("rightbottom", " "); set_lines ("topmiddle", " "); set_lines ("bottommiddle", " "); set_lines ("leftmiddle", " "); set_lines ("rightmiddle", " "); set_lines ("cross", " "); set_lines ("dvert", " "); set_lines ("dhoriz", " "); set_lines ("dlefttop", " "); set_lines ("drighttop", " "); set_lines ("dleftbottom", " "); set_lines ("drightbottom", " "); set_lines ("dtopmiddle", " "); set_lines ("dbottommiddle", " "); set_lines ("dleftmiddle", " "); set_lines ("drightmiddle", " "); }
void MainWindow::choose_file_button_clicked() { try { QString fileName = QFileDialog::getOpenFileName(this,QString::fromUtf8("Choose File"),QDir::currentPath(),"Text(*.txt)"); if (fileName.length() != 0) { // ДАЛЕЕ ОЧИСТКА ЗНАЧЕНИЙ!!! clear_data(); clear_lines(); ui->fileName->setText(fileName); QFile my_file(fileName); my_file.open(QIODevice::ReadOnly); if (my_file.isOpen()) while (!my_file.atEnd()) { QString exmpl = changeOnDoTA(my_file.readLine()); double obj = exmpl.toDouble(); started_data.push_back(obj); } try { set_average_data(); // qDebug() << max_x << " " << min_x; set_square_deviation(); set_Sx(); // for (int i = 0; i < started_data.size(); i++) // qDebug() << started_data[i]; set_r(); // КИДАЕТ ВНУТРЕННИЙ ЭКСЕПШЕН! set_h(); fill_intervals(); set_f(); set_middle_value(); set_middle_value2(); set_average_of_intervals(); set_si(); set_n_i(); set_xi_sq(); choose_quantile(); // qDebug() << "BEgin"; // for (int i = 0;i < started_data.size();i++) // qDebug() << started_data[i]; // qDebug() << "END"; set_lines(); for (int i = 0; i < intervals.size();i++) { for (int j = 0; j < intervals[i].size();j++) qDebug() << intervals[i][j]; qDebug() << "end_line"; } // check_result(); is_chButton_clicked_flag = true; my_file.close(); } catch(std::exception &e){ clear_data(); clear_lines(); is_chButton_clicked_flag = false; QMessageBox::critical(this,"Not Valid!!!",e.what()); } } else { throw (std::invalid_argument("Choose txt File!")); } } catch(std::exception& e) { clear_data(); clear_lines(); is_chButton_clicked_flag = false; // QMessageBox::critical(this, "Error!",e.what()); } }