diff options
author | Lubos Dolezel <lubos@dolezel.info> | 2015-06-02 19:32:25 +0200 |
---|---|---|
committer | Lubos Dolezel <lubos@dolezel.info> | 2015-06-02 19:32:25 +0200 |
commit | ab83223e1b5c7d34855d091e0c868462bd9452d1 (patch) | |
tree | 0890102c34727fcceea3d4e4c89ca560988b7f6d /src/gui/selectuserform.ui.h | |
parent | aa9b140a7bb49eb9666678bcbbb544cc536bd6de (diff) | |
download | twinkle-ab83223e1b5c7d34855d091e0c868462bd9452d1.tar twinkle-ab83223e1b5c7d34855d091e0c868462bd9452d1.tar.gz twinkle-ab83223e1b5c7d34855d091e0c868462bd9452d1.tar.lz twinkle-ab83223e1b5c7d34855d091e0c868462bd9452d1.tar.xz twinkle-ab83223e1b5c7d34855d091e0c868462bd9452d1.zip |
Twinkle now compiles with Qt4 uic, but crashes at runtime (due to GUI calls from outside the main thread)
Diffstat (limited to 'src/gui/selectuserform.ui.h')
-rw-r--r-- | src/gui/selectuserform.ui.h | 138 |
1 files changed, 0 insertions, 138 deletions
diff --git a/src/gui/selectuserform.ui.h b/src/gui/selectuserform.ui.h deleted file mode 100644 index 61b1fa6..0000000 --- a/src/gui/selectuserform.ui.h +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** -** ui.h extension file, included from the uic-generated form implementation. -** -** If you want to add, delete, or rename functions or slots, use -** Qt Designer to update this file, preserving your code. -** -** You should not define a constructor or destructor in this file. -** Instead, write your code in functions called init() and destroy(). -** These will automatically be called by the form's constructor and -** destructor. -*****************************************************************************/ - -/* - Copyright (C) 2005-2009 Michel de Boer <michel@twinklephone.com> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -void SelectUserForm::init() -{ - // Disable sorting - userListView->setSorting(-1); -} - -void SelectUserForm::show(t_select_purpose purpose) -{ - QString title, msg_purpose; - - // Set dialog caption and purpose - title = PRODUCT_NAME; - title += " - "; - switch (purpose) { - case SELECT_REGISTER: - title.append(tr("Register")); - msg_purpose = tr("Select users that you want to register."); - break; - case SELECT_DEREGISTER: - title.append(tr("Deregister")); - msg_purpose = tr("Select users that you want to deregister."); - break; - case SELECT_DEREGISTER_ALL: - title.append(tr("Deregister all devices")); - msg_purpose = tr("Select users for which you want to deregister all devices."); - break; - case SELECT_DND: - title.append(tr("Do not disturb")); - msg_purpose = tr("Select users for which you want to enable 'do not disturb'."); - break; - case SELECT_AUTO_ANSWER: - title.append(tr("Auto answer")); - msg_purpose = tr("Select users for which you want to enable 'auto answer'."); - break; - default: - assert(false); - } - setCaption(title); - purposeTextLabel->setText(msg_purpose); - - // Fill list view - list<t_user *> user_list = phone->ref_users(); - for (list<t_user *>::reverse_iterator i = user_list.rbegin(); i != user_list.rend(); i++) { - Q3CheckListItem *item = new Q3CheckListItem(userListView, - (*i)->get_profile_name().c_str(), Q3CheckListItem::CheckBox); - - switch (purpose) { - case SELECT_DND: - item->setOn(phone->ref_service(*i)->is_dnd_active()); - break; - case SELECT_AUTO_ANSWER: - item->setOn(phone->ref_service(*i)->is_auto_answer_active()); - break; - default: - break; - } - } - - QDialog::show(); -} - -void SelectUserForm::validate() -{ - list<t_user *> selected_list, not_selected_list; - - Q3ListViewItemIterator i(userListView); - while (i.current()) { - Q3CheckListItem *item = (Q3CheckListItem *)(i.current()); - if (item->isOn()) { - selected_list.push_back(phone-> - ref_user_profile(item->text().ascii())); - } else { - not_selected_list.push_back(phone-> - ref_user_profile(item->text().ascii())); - } - i++; - } - - emit (selection(selected_list)); - emit (not_selected(not_selected_list)); - accept(); -} - -void SelectUserForm::selectAll() -{ - Q3ListViewItemIterator i(userListView); - while (i.current()) { - Q3CheckListItem *item = (Q3CheckListItem *)(i.current()); - item->setOn(true); - i++; - } -} - -void SelectUserForm::clearAll() -{ - Q3ListViewItemIterator i(userListView); - while (i.current()) { - Q3CheckListItem *item = (Q3CheckListItem *)(i.current()); - item->setOn(false); - i++; - } -} - -void SelectUserForm::toggle(Q3ListViewItem *item) -{ - Q3CheckListItem *checkItem = (Q3CheckListItem *)item; - checkItem->setOn(!checkItem->isOn()); -} |