void users_dialog::add_user() { switch (m_tab->currentIndex()) { case 0: { user_edit_dialog dlg; if (dlg.exec() == QDialog::Accepted) { refresh_list(); refresh_role_list(); } } break; case 1: default: { role_perms_edit_dialog dlg; if (dlg.exec() == QDialog::Accepted) { refresh_list(); refresh_role_list(); } } break; } }
void users_dialog::edit_user() { switch (m_tab->currentIndex()) { case 0: { int id = selected_role_id(m_ulist); if (id) { user_edit_dialog dlg(id); if (dlg.exec() == QDialog::Accepted) { refresh_list(); refresh_role_list(); } } } break; case 1: default: { int id = selected_role_id(m_glist); if (id) { role_perms_edit_dialog dlg(id); if (dlg.exec() == QDialog::Accepted) { refresh_list(); refresh_role_list(); } } } break; } }
/*virtual*/ void gui_filterbar_c::created() { set_theme_rect(CONSTASTR("filter"), false); filtereditheight = gui->theme().conf().get_int(CONSTASTR("filtereditheight"), 25); if (prf().get_options().is(UIOPT_SHOW_SEARCH_BAR)) { gui_textfield_c &e = (MAKE_CHILD<gui_textfield_c>(getrid(), L"", MAX_PATH, 0, false) << (gui_textedit_c::TEXTCHECKFUNC)DELEGATE(this, update_filter)); edit = &e; e.set_placeholder(TOOLTIP(TTT("Search", 277)), get_default_text_color(COL_PLACEHOLDER)); e.register_kbd_callback(DELEGATE(this, cancel_filter), SSK_ESC, false); } if (prf().get_options().is(UIOPT_TAGFILETR_BAR)) { fill_tags(); } search_in_messages = prf().is_loaded() && prf().get_options().is(MSGOP_FULL_SEARCH); if (!is_all()) refresh_list(); __super::created(); }
void ui_find(int next) { int item = -1; static char findstr[MAX_FIELD_LEN]; int search_fields[] = {NAME, EMAIL, NICK, -1}; clear_statusline(); if(next) { if(!*findstr) return; } else { char *s; s = ui_readline("/", findstr, MAX_FIELD_LEN - 1, 0); refresh_screen(); if(s == NULL) { return; /* user cancelled (ctrl-G) */ } else { strncpy(findstr, s, MAX_FIELD_LEN); free(s); } } if( (item = find_item(findstr, list_get_curitem() + !!next, search_fields)) < 0 && (item = find_item(findstr, 0, search_fields)) >= 0) statusline_addstr(_("Search hit bottom, continuing at top")); if(item >= 0) { list_set_curitem(item); refresh_list(); } }
static void set_window (GeditDocumentsPanel *panel, GeditWindow *window) { gedit_debug (DEBUG_PANEL); g_return_if_fail (panel->priv->window == NULL); g_return_if_fail (GEDIT_IS_WINDOW (window)); panel->priv->window = g_object_ref (window); panel->priv->mnb = GEDIT_MULTI_NOTEBOOK (_gedit_window_get_multi_notebook (window)); g_signal_connect (panel->priv->mnb, "notebook-removed", G_CALLBACK (multi_notebook_notebook_removed), panel); g_signal_connect (panel->priv->mnb, "tab-added", G_CALLBACK (multi_notebook_tab_added), panel); g_signal_connect (panel->priv->mnb, "tab-removed", G_CALLBACK (multi_notebook_tab_removed), panel); g_signal_connect (panel->priv->mnb, "page-reordered", G_CALLBACK (multi_notebook_tabs_reordered), panel); g_signal_connect (panel->priv->mnb, "switch-tab", G_CALLBACK (multi_notebook_tab_switched), panel); refresh_list (panel); }
static void multi_notebook_notebook_removed (GeditMultiNotebook *mnb, GeditNotebook *notebook, GeditDocumentsPanel *panel) { refresh_list (panel); }
void ui_clear_database() { if(statusline_ask_boolean(_("Clear WHOLE database"), FALSE)) { close_database(); refresh_list(); } }
void goto_end() { if(db_n_items() > 0) curitem = last_item(); refresh_list(); }
void goto_home() { if(db_n_items() > 0) curitem = 0; refresh_list(); }
void tinapp_purchase::pre_show(CVideo& /*video*/, twindow& window) { std::stringstream strstr; if (browse_) { utils::string_map symbols; symbols["platforms"] = tintegrate::generate_format("iOS", "green"); tlabel* label = find_widget<tlabel>(&window, "flag", false, true); strstr.str(""); strstr << "("; strstr << vgettext2("Only $platforms support in-app purchase", symbols); strstr << ")"; label->set_label(strstr.str()); } restore_ = find_widget<tbutton>(&window, "restore", false, true); purchase_ = find_widget<tbutton>(&window, "purchase", false, true); status_ = find_widget<tlabel>(&window, "status", false, true); list_ = find_widget<tlistbox>(&window, "item_list", false, true); refresh_list(true); list_->set_callback_value_change(dialog_callback3<tinapp_purchase, tlistbox, &tinapp_purchase::item_selected>); // current no non-consumable in-purchase, don't use restore purchase_->set_active(!browse_); bool no_nonconsumable = true; for (std::vector<tinapp_item>::const_iterator it = items_.begin(); it != items_.end(); ++ it) { if (!it->consumable) { no_nonconsumable = false; break; } } if (no_nonconsumable) { restore_->set_visible(twidget::INVISIBLE); } connect_signal_mouse_left_click( find_widget<tbutton>(&window, "restore", false) , boost::bind( &tinapp_purchase::restore , this , boost::ref(window))); connect_signal_mouse_left_click( find_widget<tbutton>(&window, "purchase", false) , boost::bind( &tinapp_purchase::purchase , this , boost::ref(window))); connect_signal_mouse_left_click( find_widget<tbutton>(&window, "quit", false) , boost::bind( &tinapp_purchase::quit , this , boost::ref(window))); startShop(); }
/* This gets called when an option from the popup menu (Copy/Move/Link) is * chosen */ static void drag_op_cb(GtkWidget *widget, gpointer data) { gchar *dest_dir, *file_list; gchar dest[PATH_MAX+NAME_MAX]; gchar *s, *filename; int (*op_func)(gchar *, gchar *) = data; gboolean check = cfg.confirm_overwrite; gint result; dest_dir = gtk_object_get_data(GTK_OBJECT(widget), "dest_dir"); file_list = gtk_object_get_data(GTK_OBJECT(widget), "file_list"); /* file_list is a string of the format: * file:/path/to/one_file\r\nfile:/path/to/second_file\r\n * and so on */ while ((s = strstr(file_list, "\r\n")) != NULL) { *s = '\0'; file_list += 5; /* Skip over 'file:' */ filename = strrchr(file_list, '/'); /* extract the filename */ g_snprintf(dest, sizeof(dest), "%s%s", dest_dir, filename+1); if (check && (access(dest, F_OK) == 0)) { gtk_widget_set_sensitive(app.main_window, FALSE); result = op_with_ow_check(file_list, dest, op_func); gtk_widget_set_sensitive(app.main_window, TRUE); if (result == YES_TO_ALL) check = FALSE; else if (result == CANCEL) break; } else op_func(file_list, dest); file_list = s + 2; /* Skip over the '\r\n' */ } gtk_widget_destroy(app.drag_op_menu); refresh_list(other_view); refresh_list(other_view); }
bool gui_filterbar_c::option_handler(RID, GUIPARAM p) { search_in_messages = p != nullptr; if (prf().is_loaded()) prf().set_options( search_in_messages ? MSGOP_FULL_SEARCH : 0, MSGOP_FULL_SEARCH ); found_stuff.fsplit.clear(); refresh_list(); return true; }
static void window_tabs_reordered (PlumaWindow *window, PlumaDocumentsPanel *panel) { if (panel->priv->is_reodering) return; refresh_list (panel); }
void scroll_down() { if(curitem > db_n_items() - 2) return; curitem++; refresh_list(); }
void scroll_up() { if(curitem < 1) return; curitem--; refresh_list(); }
wireless_scan *show_menu() { /* Init ncurses */ initscr(); raw(); noecho(); curs_set(0); start_color(); use_default_colors(); init_pair(1,1,-1); init_pair(2,2,-1); init_pair(3,3,-1); init_pair(4,4,-1); init_pair(5,5,-1); init_pair(6,6,-1); init_pair(7,7,-1); /* Select entry */ wireless_scan *ws, *ss; int running = True; int c,i,sel = 0; int n = refresh_list(); while (running) { move(0,0); attrset(COLOR_PAIR(4)|A_REVERSE|A_BOLD); printw(" * %-*s %% \n",IW_ESSID_MAX_SIZE+2,"Network"); for (ws = context.result, i=0; ws; ws = ws->next) if ((mode & MODE_HIDDEN) || strlen(ws->b.essid)) { if (i == sel) ss = ws; draw_entry(ws,((i++)==sel)); } attrset(COLOR_PAIR(4)|A_REVERSE|A_BOLD); printw(" %-*s \n",IW_ESSID_MAX_SIZE+8," "); refresh(); c = getchar(); if (c == 'q') running = False; else if (c == 13) break; else if (c == 'r') n = refresh_list(); else if (c == 'j' || c == 66) sel++; else if (c == 'k' || c == 65) sel--; if (sel >= n) sel = n; else if (sel < 0) sel = 0; } endwin(); if (!running) { /* "q" selected */ iw_sockets_close(skfd); exit(0); } for (i = 0, ws = context.result; i != sel; ws = ws->next) if ((mode & MODE_HIDDEN) || strlen(ws->b.essid)) i++; /* End ncurses session & return result */ return ws; }
void page_up() { if(curitem < 1) return; curitem = curitem == first_list_item ? ((curitem -= LIST_LINES) < 0 ? 0 : curitem) : first_list_item; refresh_list(); }
void scroll_list_up() { if(first_list_item <= 0) { if(curitem != 0) { curitem--; refresh_list(); } return; } first_list_item -= scroll_speed; if(first_list_item < 0) { first_list_item = 0; } if(curitem > LAST_LIST_ITEM) { curitem = LAST_LIST_ITEM; } refresh_list(); }
void scroll_list_down() { if(LAST_LIST_ITEM > db_n_items() - 2) { if(curitem < LAST_LIST_ITEM) { curitem++; refresh_list(); } return; } first_list_item += scroll_speed; if(LAST_LIST_ITEM > db_n_items() - 1) { first_list_item = db_n_items() - LIST_LINES; } if(curitem < first_list_item) { curitem = first_list_item; } refresh_list(); }
void ui_remove_items() { if(list_is_empty()) return; if(statusline_ask_boolean(_("Remove selected item(s)"), TRUE)) remove_selected_items(); clear_statusline(); refresh_list(); }
static void window_tab_removed (PlumaWindow *window, PlumaTab *tab, PlumaDocumentsPanel *panel) { g_signal_handlers_disconnect_by_func (tab, G_CALLBACK (sync_name_and_icon), panel); if (_pluma_window_is_removing_tabs (window)) gtk_list_store_clear (GTK_LIST_STORE (panel->priv->model)); else refresh_list (panel); }
static void multi_notebook_tabs_reordered (GeditMultiNotebook *mnb, GeditNotebook *notebook, GtkWidget *page, gint page_num, GeditDocumentsPanel *panel) { gedit_debug (DEBUG_PANEL); if (panel->priv->is_reodering) return; refresh_list (panel); }
void page_down() { if(curitem > db_n_items() - 2) return; if(curitem == LAST_LIST_ITEM) { if((curitem += LIST_LINES) > last_item()) curitem = last_item(); } else { curitem = min(LAST_LIST_ITEM, last_item()); } refresh_list(); }
void gui_filterbar_c::do_tag_click(int lnk) { if ( lnk < BIT_count ) { // process buildin tags INVERTFLAG( bitags, (1<<lnk) ); prf().bitags( bitags ); } else { lnk -= BIT_count; contacts().toggle_tag(lnk); } refresh_list(); textrect.make_dirty(); getengine().redraw(); }
void refresh_screen() { #ifdef SIGWINCH if(should_resize) { resize_abook(); return; } #endif clear(); refresh_statusline(); headerline(gettext(MAIN_HELPLINE)); list_headerline(); refresh_list(); }
static void multi_notebook_tab_removed (GeditMultiNotebook *mnb, GeditNotebook *notebook, GeditTab *tab, GeditDocumentsPanel *panel) { gedit_debug (DEBUG_PANEL); g_signal_handlers_disconnect_by_func (gedit_tab_get_document (tab), G_CALLBACK (document_changed), panel); g_signal_handlers_disconnect_by_func (tab, G_CALLBACK (sync_name_and_icon), panel); refresh_list (panel); }
void PostListPage::post_message() { if (!_client || !_client->is_authenticated()) return; const QString message = _ui->postText->toPlainText(); if (message.isEmpty()) return; try { _client->send_post(message, _ui->colorWidget->selected_color()); _ui->postText->clear(); refresh_list(); } catch(...) { // TODO: display error message } }
static void multi_notebook_tab_added (GeditMultiNotebook *mnb, GeditNotebook *notebook, GeditTab *tab, GeditDocumentsPanel *panel) { gedit_debug (DEBUG_PANEL); g_signal_connect (tab, "notify::name", G_CALLBACK (sync_name_and_icon), panel); g_signal_connect (tab, "notify::state", G_CALLBACK (sync_name_and_icon), panel); refresh_list (panel); }
void ui_read_database() { char *msg; if(!list_is_empty()) { msg = strdup_printf(_("Your current data will be lost - " "Press '%c' to continue"), *(S_("keybinding for yes|y"))); if(!statusline_ask_boolean(msg, FALSE)) { free(msg); return; } free(msg); } load_database(datafile); refresh_list(); }
void users_dialog::init() { m_user_list = users_repository::get_list(); m_ulist->setHeaderLabels(QStringList() << tr("Login") << tr("Can connect") << tr("Operator name")); QTreeWidgetItem* h = m_ulist->headerItem(); h->setToolTip(0, tr("Database login")); h->setToolTip(1, tr("Checked if allowed to connect to this database")); h->setToolTip(2, tr("Name as a Manitou-Mail operator in this database")); QFontMetrics m(m_ulist->font()); m_ulist->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); setMinimumWidth(m.width("a")*60); refresh_list(); refresh_role_list(); m_ulist->adjustSize(); m_glist->setHeaderLabels(QStringList() << tr("Role")); }