UICSettingsDialog::UICSettingsDialog(QWidget *parent) : QDialog(parent), ui(new Ui::UICSettingsDialog) { ui->setupUi(this); findLolDirectory(); connect(ui->btn_browse,SIGNAL(clicked()),this,SLOT(on_browse())); connect(ui->btn_apply,SIGNAL(clicked()),this,SLOT(on_apply())); }
new_db::new_db(QWidget *parent):sub_win(parent) { this->setWindowTitle("New Database"); this->resize(400,200); this->setWindowFlags(Qt::WindowCloseButtonHint); admin_email = new QLabel("Admin Email: ", this); password = new QLabel("Password: "******"Choose Folder: ", this); give_db_name = new QLabel("Database File Name: "); email_line = new QLineEdit(this); pass_line = new QLineEdit(this); pass_line->setEchoMode(QLineEdit::Password); dir_line = new QLineEdit(this); db_name_line = new QLineEdit(this); nokay = new QPushButton("Okay", this); ncancel = new QPushButton("Cancel", this); browse = new QPushButton("Browse..", this); QGridLayout* grid = new QGridLayout(); grid->addWidget(admin_email, 0, 0); grid->addWidget(email_line, 0, 1); grid->addWidget(password, 1, 0); grid->addWidget(pass_line, 1, 1); grid->addWidget(give_db_name, 2, 0); grid->addWidget(db_name_line, 2, 1); QVBoxLayout *vbox = new QVBoxLayout(this); vbox->addLayout(grid); vbox->addSpacing(10); QGridLayout* grid2 = new QGridLayout(); grid2->addWidget(choose_dir, 0, 1); grid2->addWidget(browse, 0, 2); grid2->addWidget(dir_line, 0, 3); vbox->addLayout(grid2); QHBoxLayout* hbox = new QHBoxLayout(); hbox->addWidget(nokay, 1, Qt::AlignRight); hbox->addWidget(ncancel, 0); vbox->addStretch(1); vbox->addLayout(hbox); setLayout(vbox); connect(browse, SIGNAL(clicked()), this, SLOT(on_browse())); connect(nokay, SIGNAL(clicked()), this, SLOT(on_okay())); connect(ncancel, SIGNAL(clicked()), this, SLOT(close_me())); }
/* Dialog procedure for IDD_IDSEL runs in UI thread */ static INT_PTR CALLBACK idspec_dlg_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { case WM_INITDIALOG: { struct idsel_dlg_data * d; d = PMALLOC(sizeof(*d)); ZeroMemory(d, sizeof(*d)); d->magic = IDSEL_DLG_DATA_MAGIC; d->identity = NULL; #pragma warning(push) #pragma warning(disable: 4244) SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR) d); #pragma warning(pop) /* TODO: Initialize controls etc. */ } CheckRadioButton(hwnd, IDC_REGISTRY, IDC_FILE, IDC_REGISTRY); EnableWindow(GetDlgItem(hwnd, IDC_PATH), FALSE); EnableWindow(GetDlgItem(hwnd, IDC_BROWSE), FALSE); SendDlgItemMessage(hwnd, IDC_NAME, EM_SETLIMITTEXT, KCDB_MAXCCH_NAME, 0); SendDlgItemMessage(hwnd, IDC_DESCRIPTION, EM_SETLIMITTEXT, KCDB_MAXCCH_SHORT_DESC, 0); SendDlgItemMessage(hwnd, IDC_PATH, EM_SETLIMITTEXT, MAX_PATH, 0); { wchar_t cuebanner[KCDB_MAXCCH_NAME]; LoadString(hResModule, IDS_CUE_NAME, cuebanner, ARRAYLENGTH(cuebanner)); SendDlgItemMessage(hwnd, IDC_NAME, EM_SETCUEBANNER, 0, (LPARAM)cuebanner); LoadString(hResModule, IDS_CUE_DESC, cuebanner, ARRAYLENGTH(cuebanner)); SendDlgItemMessage(hwnd, IDC_DESCRIPTION, EM_SETCUEBANNER, 0, (LPARAM)cuebanner); } /* We return FALSE here because this is an embedded modeless dialog and we don't want to steal focus from the container. */ return FALSE; case WM_DESTROY: { struct idsel_dlg_data * d; d = (struct idsel_dlg_data *)(LONG_PTR) GetWindowLongPtr(hwnd, DWLP_USER); #ifdef DEBUG assert(d != NULL); assert(d->magic == IDSEL_DLG_DATA_MAGIC); #endif if (d && d->magic == IDSEL_DLG_DATA_MAGIC) { if (d->identity) { kcdb_identity_release(d->identity); d->identity = NULL; } d->magic = 0; PFREE(d); } #pragma warning(push) #pragma warning(disable: 4244) SetWindowLongPtr(hwnd, DWLP_USER, 0); #pragma warning(pop) } return TRUE; case WM_COMMAND: { switch (wParam) { case MAKEWPARAM(IDC_REGISTRY, BN_CLICKED): EnableWindow(GetDlgItem(hwnd, IDC_PATH), FALSE); EnableWindow(GetDlgItem(hwnd, IDC_BROWSE), FALSE); return TRUE; case MAKEWPARAM(IDC_FILE, BN_CLICKED): EnableWindow(GetDlgItem(hwnd, IDC_PATH), TRUE); EnableWindow(GetDlgItem(hwnd, IDC_BROWSE), TRUE); return TRUE; case MAKEWPARAM(IDC_BROWSE, BN_CLICKED): return on_browse(hwnd); } } break; case KHUI_WM_NC_NOTIFY: { struct idsel_dlg_data * d; khm_handle * ph; d = (struct idsel_dlg_data *)(LONG_PTR) GetWindowLongPtr(hwnd, DWLP_USER); switch (HIWORD(wParam)) { case WMNC_IDSEL_GET_IDENT: ph = (khm_handle *) lParam; on_get_ident(hwnd, d, ph); break; } } return TRUE; } return FALSE; }