TimeEntryDialog::TimeEntryDialog( QWidget * parent ) : QDialog( parent ) { setupUi( this ); mAssetModel = new ElementModel( mAssetTree ); mAssetModel->setSecondColumnIsLocation( true ); mAssetTree->setModel( mAssetModel ); // mCalendarButton->hide(); connect( mChooseStartDateButton, SIGNAL( clicked() ), SLOT( chooseStartDate() ) ); connect( mChooseEndDateButton, SIGNAL( clicked() ), SLOT( chooseEndDate() ) ); connect( mProjectCombo, SIGNAL( activated( const QString & ) ), SLOT( projectSelected( const QString & ) ) ); connect( mTypeCombo, SIGNAL( currentChanged( const Record & ) ), SLOT( assetTypeChanged( const Record & ) ) ); connect( mAssetFilterEdit, SIGNAL( textChanged( const QString & ) ), SLOT( slotFilterAssets() ) ); setDateRange( QDate::currentDate() ); ProjectList pl = Project::select().filter( "fkeyProjectStatus", 4 ).sorted( "name" ); mProject = pl[0]; mProjectCombo->addItems( pl.names() ); mTypeCombo->setTagFilters( QStringList() << "timesheet" ); mTypeCombo->setShowFirst( User::currentUser().roles() ); mAssetType = mTypeCombo->current(); mUser = User::currentUser(); mForcedProjectCategories += "Vacation"; mForcedProjectCategories += "Sick"; mForcedProjectCategories += "Comp Time"; mForcedProjectCategories += "Unpaid Leave"; mForcedProjectCategories += "Holidays"; mVirtualProject = Project::recordByName( "_virtual_project" ); }
void ScheduleDialog::setSchedule( const Schedule & schedule ) { mSchedule = schedule; setWindowTitle( "Modify Schedule..." ); mDateEndEdit->setEnabled( false ); setDateRange( schedule.date(), schedule.date() ); // setAssetType( schedule.assetType() ); setElement( schedule.element(), schedule.assetType() ); setEmployee( schedule.user() ); mHoursSpin->setValue( schedule.duration().hours() ); }
void TimeEntryDialog::setTimeSheet( const TimeSheet & ts ) { mTimeSheet = ts; mUser = mTimeSheet.user(); setDateRange( ts.dateTime().date() ); setProject( ts.project() ); setAssetType( ts.assetType() ); mHoursSpin->setValue( ts.scheduledHour() ); mCommentEdit->setPlainText( ts.comment() ); setElementList( ts.element() ); }
void LLInventoryFilter::setDateRangeLastLogoff(BOOL sl) { if (sl && !isSinceLogoff()) { setDateRange(mLastLogoff, time_max()); setModified(); } if (!sl && isSinceLogoff()) { setDateRange(time_min(), time_max()); setModified(); } if (areDateLimitsSet()) { mFilterOps.mFilterTypes |= FILTERTYPE_DATE; } else { mFilterOps.mFilterTypes &= ~FILTERTYPE_DATE; } }
LLInventoryFilter& LLInventoryFilter::operator=( const LLInventoryFilter& other ) { setFilterObjectTypes(other.getFilterObjectTypes()); setDateRange(other.getMinDate(), other.getMaxDate()); setHoursAgo(other.getHoursAgo()); setDateSearchDirection(other.getDateSearchDirection()); setShowFolderState(other.getShowFolderState()); setFilterPermissions(other.getFilterPermissions()); setFilterSubString(other.getFilterSubString()); setDateRangeLastLogoff(other.isSinceLogoff()); setFilterWorn(other.getFilterWorn()); return *this; }
void LLInventoryFilter::setDateRangeLastLogoff(BOOL sl) { static LLCachedControl<U32> s_last_logoff(gSavedPerAccountSettings, "LastLogoff", 0); if (sl && !isSinceLogoff()) { setDateRange(s_last_logoff(), time_max()); setModified(); } if (!sl && isSinceLogoff()) { setDateRange(time_min(), time_max()); setModified(); } if (areDateLimitsSet()) { mFilterOps.mFilterTypes |= FILTERTYPE_DATE; } else { mFilterOps.mFilterTypes &= ~FILTERTYPE_DATE; } }
void LLInventoryFilter::fromLLSD(LLSD& data) { if(data.has("filter_types")) { setFilterObjectTypes((U64)data["filter_types"].asInteger()); } if(data.has("min_date") && data.has("max_date")) { setDateRange(data["min_date"].asInteger(), data["max_date"].asInteger()); } if(data.has("hours_ago")) { setHoursAgo((U32)data["hours_ago"].asInteger()); } if(data.has("show_folder_state")) { setShowFolderState((EFolderShow)data["show_folder_state"].asInteger()); } if(data.has("permissions")) { setFilterPermissions((PermissionMask)data["permissions"].asInteger()); } if(data.has("substring")) { setFilterSubString(std::string(data["substring"].asString())); } if(data.has("sort_order")) { setSortOrder((U32)data["sort_order"].asInteger()); } if(data.has("since_logoff")) { setDateRangeLastLogoff((bool)data["since_logoff"].asBoolean()); } }
ScheduleDialog::ScheduleDialog( QWidget * parent ) : QDialog( parent ) , mAssetModel( 0 ) , mDisableUpdates( false ) { setupUi( this ); mAssetModel = new ElementModel( mAssetTree ); mAssetModel->setSecondColumnIsLocation( true ); mAssetModel->setAutoSort( true ); mAssetTree->setModel( mAssetModel ); mUserModel = new ElementModel( mUserCombo ); mUserModel->setAutoSort( true ); mUserCombo->setModel( mUserModel ); mUserCombo->setModelColumn( 0 ); // connect( mCalendarButton, SIGNAL( clicked() ), SLOT( showCalendar() ) ); connect( mProjectCombo, SIGNAL( activated( const QString & ) ), SLOT( projectSelected( const QString & ) ) ); connect( mTypeCombo, SIGNAL( currentChanged( const Record & ) ), SLOT( assetTypeChanged( const Record & ) ) ); connect( mTypeFilterCheck, SIGNAL( toggled( bool ) ), SLOT( setUseTypeFilter( bool ) ) ); connect( mTypeFilterAssetsCheck, SIGNAL( toggled( bool ) ), SLOT( setUseAssetsTypeFilter( bool ) ) ); connect( mUserCombo, SIGNAL( currentChanged( const Record & ) ), SLOT( employeeSelected( const Record & ) ) ); connect( mChooseStartDateButton, SIGNAL( clicked() ), SLOT( chooseStartDate() ) ); connect( mChooseEndDateButton, SIGNAL( clicked() ), SLOT( chooseEndDate() ) ); QDate d( QDate::currentDate() ); setDateRange( d, d ); ProjectList pl = Project::select().filter( "fkeyProjectStatus", 4 ).sorted( "name" ); mProject = pl[0]; mProjectCombo->addItems( pl.names() ); mTypeCombo->setTagFilters( QStringList() << "schedule" ); mAssetType = mTypeCombo->current(); updateUsers(); mDateStartEdit->setMaximumDate( QDate::currentDate() ); mDateEndEdit->setMinimumDate( QDate::currentDate() ); }
void TimeEntryDialog::chooseEndDate() { setDateRange( mStartDateEdit->date(), DateChooserDialog::getDate(this,mEndDateEdit->date()) ); }
int QCalendarWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: selectionChanged(); break; case 1: clicked((*reinterpret_cast< const QDate(*)>(_a[1]))); break; case 2: activated((*reinterpret_cast< const QDate(*)>(_a[1]))); break; case 3: currentPageChanged((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; case 4: setSelectedDate((*reinterpret_cast< const QDate(*)>(_a[1]))); break; case 5: setDateRange((*reinterpret_cast< const QDate(*)>(_a[1])),(*reinterpret_cast< const QDate(*)>(_a[2]))); break; case 6: setCurrentPage((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; case 7: setGridVisible((*reinterpret_cast< bool(*)>(_a[1]))); break; case 8: setNavigationBarVisible((*reinterpret_cast< bool(*)>(_a[1]))); break; case 9: showNextMonth(); break; case 10: showPreviousMonth(); break; case 11: showNextYear(); break; case 12: showPreviousYear(); break; case 13: showSelectedDate(); break; case 14: showToday(); break; case 15: d_func()->_q_slotShowDate((*reinterpret_cast< const QDate(*)>(_a[1]))); break; case 16: d_func()->_q_slotChangeDate((*reinterpret_cast< const QDate(*)>(_a[1]))); break; case 17: d_func()->_q_slotChangeDate((*reinterpret_cast< const QDate(*)>(_a[1])),(*reinterpret_cast< bool(*)>(_a[2]))); break; case 18: d_func()->_q_editingFinished(); break; case 19: d_func()->_q_prevMonthClicked(); break; case 20: d_func()->_q_nextMonthClicked(); break; case 21: d_func()->_q_yearEditingFinished(); break; case 22: d_func()->_q_yearClicked(); break; case 23: d_func()->_q_monthChanged((*reinterpret_cast< QAction*(*)>(_a[1]))); break; default: ; } _id -= 24; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QDate*>(_v) = selectedDate(); break; case 1: *reinterpret_cast< QDate*>(_v) = minimumDate(); break; case 2: *reinterpret_cast< QDate*>(_v) = maximumDate(); break; case 3: *reinterpret_cast< Qt::DayOfWeek*>(_v) = firstDayOfWeek(); break; case 4: *reinterpret_cast< bool*>(_v) = isGridVisible(); break; case 5: *reinterpret_cast< SelectionMode*>(_v) = selectionMode(); break; case 6: *reinterpret_cast< HorizontalHeaderFormat*>(_v) = horizontalHeaderFormat(); break; case 7: *reinterpret_cast< VerticalHeaderFormat*>(_v) = verticalHeaderFormat(); break; case 8: *reinterpret_cast< bool*>(_v) = isHeaderVisible(); break; case 9: *reinterpret_cast< bool*>(_v) = isNavigationBarVisible(); break; case 10: *reinterpret_cast< bool*>(_v) = isDateEditEnabled(); break; case 11: *reinterpret_cast< int*>(_v) = dateEditAcceptDelay(); break; } _id -= 12; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setSelectedDate(*reinterpret_cast< QDate*>(_v)); break; case 1: setMinimumDate(*reinterpret_cast< QDate*>(_v)); break; case 2: setMaximumDate(*reinterpret_cast< QDate*>(_v)); break; case 3: setFirstDayOfWeek(*reinterpret_cast< Qt::DayOfWeek*>(_v)); break; case 4: setGridVisible(*reinterpret_cast< bool*>(_v)); break; case 5: setSelectionMode(*reinterpret_cast< SelectionMode*>(_v)); break; case 6: setHorizontalHeaderFormat(*reinterpret_cast< HorizontalHeaderFormat*>(_v)); break; case 7: setVerticalHeaderFormat(*reinterpret_cast< VerticalHeaderFormat*>(_v)); break; case 8: setHeaderVisible(*reinterpret_cast< bool*>(_v)); break; case 9: setNavigationBarVisible(*reinterpret_cast< bool*>(_v)); break; case 10: setDateEditEnabled(*reinterpret_cast< bool*>(_v)); break; case 11: setDateEditAcceptDelay(*reinterpret_cast< int*>(_v)); break; } _id -= 12; } else if (_c == QMetaObject::ResetProperty) { _id -= 12; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 12; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 12; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 12; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 12; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 12; } #endif // QT_NO_PROPERTIES return _id; }
void ScheduleDialog::chooseEndDate() { setDateRange( mDateStartEdit->date(), DateChooserDialog::getDate(this,mDateEndEdit->date()) ); }
void LLInventoryFilter::fromParams(const Params& params) { if (!params.validateBlock()) { return; } // <FS:Ansariel> FIRE-12418: Only apply filter params if they are really provided //setFilterObjectTypes(params.filter_ops.types); //setFilterCategoryTypes(params.filter_ops.category_types); //setFilterWearableTypes(params.filter_ops.wearable_types); //setDateRange(params.filter_ops.date_range.min_date, params.filter_ops.date_range.max_date); //setHoursAgo(params.filter_ops.hours_ago); //setDateSearchDirection(params.filter_ops.date_search_direction); //setShowFolderState(params.filter_ops.show_folder_state); //setFilterPermissions(params.filter_ops.permissions); //setFilterSubString(params.substring); //setDateRangeLastLogoff(params.since_logoff); if (params.filter_ops.types.isProvided()) { setFilterObjectTypes(params.filter_ops.types); } if (params.filter_ops.category_types.isProvided()) { setFilterCategoryTypes(params.filter_ops.category_types); } if (params.filter_ops.wearable_types.isProvided()) { setFilterWearableTypes(params.filter_ops.wearable_types); } if (params.filter_ops.date_range.min_date.isProvided() && params.filter_ops.date_range.max_date.isProvided()) { setDateRange(params.filter_ops.date_range.min_date, params.filter_ops.date_range.max_date); } if (params.filter_ops.hours_ago.isProvided()) { setHoursAgo(params.filter_ops.hours_ago); } if (params.filter_ops.date_search_direction.isProvided()) { setDateSearchDirection(params.filter_ops.date_search_direction); } if (params.filter_ops.show_folder_state.isProvided()) { setShowFolderState(params.filter_ops.show_folder_state); } if (params.filter_ops.permissions.isProvided()) { setFilterPermissions(params.filter_ops.permissions); } // <FS:Ansariel> FIRE-8947: Don't restore filter string on relog //if (params.substring.isProvided()) //{ // setFilterSubString(params.substring); //} if (params.since_logoff.isProvided()) { setDateRangeLastLogoff(params.since_logoff); } // </FS:Ansariel> }