Commit f9a72c06 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Andreas Traczyk

fix: name compatibility with lrc

Update Media->media to follow lrc changes

Change-Id: I237c3ff5aeb650ddebcfa5f3c4b326d1d482b150
Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent 64d6382d
......@@ -180,21 +180,21 @@ static void ReachabilityCallback(SCNetworkReachabilityRef __unused target, SCNet
}
});
QObject::connect(&Media::RecordingModel::instance(),
&Media::RecordingModel::newTextMessage,
[=](Media::TextRecording* t, ContactMethod* cm) {
QObject::connect(&media::RecordingModel::instance(),
&media::RecordingModel::newTextMessage,
[=](media::TextRecording* t, ContactMethod* cm) {
BOOL shouldNotify = [[NSUserDefaults standardUserDefaults] boolForKey:Preferences::Notifications];
auto qIdx = t->instantTextMessagingModel()->index(t->instantTextMessagingModel()->rowCount()-1, 0);
// Don't show a notification if we are sending the text OR window already has focus OR user disabled notifications
if(qvariant_cast<Media::Media::Direction>(qIdx.data((int)Media::TextRecording::Role::Direction)) == Media::Media::Direction::OUT
if(qvariant_cast<media::Media::Direction>(qIdx.data((int)media::TextRecording::Role::Direction)) == media::Media::Direction::OUT
|| self.ringWindowController.window.isMainWindow || !shouldNotify)
return;
NSUserNotification* notification = [[NSUserNotification alloc] init];
NSString* localizedTitle = [NSString stringWithFormat:NSLocalizedString(@"Message from %@", @"Message from {Name}"), qIdx.data((int)Media::TextRecording::Role::AuthorDisplayname).toString().toNSString()];
NSString* localizedTitle = [NSString stringWithFormat:NSLocalizedString(@"Message from %@", @"Message from {Name}"), qIdx.data((int)media::TextRecording::Role::AuthorDisplayname).toString().toNSString()];
[notification setTitle:localizedTitle];
[notification setSoundName:NSUserNotificationDefaultSoundName];
......
......@@ -64,11 +64,11 @@
[self.inputDeviceList addItemWithTitle:
Audio::Settings::instance().inputDeviceModel()->data(qInputIdx, Qt::DisplayRole).toString().toNSString()];
[self.alwaysRecordingButton setState:
Media::RecordingModel::instance().isAlwaysRecording() ? NSOnState:NSOffState];
media::RecordingModel::instance().isAlwaysRecording() ? NSOnState:NSOffState];
[self.muteDTMFButton setState:
Audio::Settings::instance().areDTMFMuted()?NSOnState:NSOffState];
NSArray* pathComponentArray = [self pathComponentArrayWithCurrentUrl:Media::RecordingModel::instance().recordPath().toNSString()];
NSArray* pathComponentArray = [self pathComponentArrayWithCurrentUrl:media::RecordingModel::instance().recordPath().toNSString()];
[recordingsPathControl setPathComponentCells:pathComponentArray];
if (appSandboxed()) {
......@@ -89,14 +89,14 @@
- (IBAction)toggleAlwaysRecording:(NSButton *)sender
{
Media::RecordingModel::instance().setAlwaysRecording([sender state] == NSOnState);
media::RecordingModel::instance().setAlwaysRecording([sender state] == NSOnState);
}
- (IBAction)pathControlSingleClick:(id)sender {
// Select that chosen component of the path.
NSArray* pathComponentArray = [self pathComponentArrayWithCurrentUrl:[[self.recordingsPathControl clickedPathComponentCell] URL].path];
[recordingsPathControl setPathComponentCells:pathComponentArray];
Media::RecordingModel::instance().setRecordPath(QString::fromNSString([self.recordingsPathControl.URL path]));
media::RecordingModel::instance().setRecordPath(QString::fromNSString([self.recordingsPathControl.URL path]));
}
- (IBAction)chooseOutput:(id)sender {
......
......@@ -134,7 +134,7 @@
- (IBAction)clearHistory:(id)sender {
CategorizedHistoryModel::instance().clearAllCollections();
Media::RecordingModel::instance().clearAllCollections();
media::RecordingModel::instance().clearAllCollections();
[historyChangedLabel setHidden:NO];
}
......
......@@ -135,7 +135,7 @@ NSString* const kChangeAccountToolBarItemIdentifier = @"ChangeAccountToolBarIte
lrc_->getDataTransferModel().downloadDirectory = std::string([path UTF8String]);
if(appSandboxed()) {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
Media::RecordingModel::instance().setRecordPath(QString::fromNSString([paths objectAtIndex:0]));
media::RecordingModel::instance().setRecordPath(QString::fromNSString([paths objectAtIndex:0]));
}
}
......
......@@ -171,7 +171,7 @@
if ( [sender draggingSource] != self ) {
NSURL* fileURL = [NSURL URLFromPasteboard: [sender draggingPasteboard]];
if (auto current = CallModel::instance().selectedCall()) {
if (auto outVideo = current->firstMedia<Media::Video>(Media::Media::Direction::OUT)) {
if (auto outVideo = current->firstMedia<media::Video>(media::Media::Direction::OUT)) {
outVideo->sourceModel()->setFile(QUrl::fromLocalFile(QString::fromUtf8([fileURL.path UTF8String])));
return YES;
}
......@@ -235,7 +235,7 @@
{
int index = [contextualMenu indexOfItem:sender];
if (auto current = CallModel::instance().selectedCall()) {
if (auto outVideo = current->firstMedia<Media::Video>(Media::Media::Direction::OUT)) {
if (auto outVideo = current->firstMedia<media::Video>(media::Media::Direction::OUT)) {
outVideo->sourceModel()->switchTo(Video::DeviceModel::instance().devices()[index]);
}
}
......@@ -260,7 +260,7 @@
if (result == NSFileHandlingPanelOKButton) {
NSURL* theDoc = [[browsePanel URLs] objectAtIndex:0];
if (auto current = CallModel::instance().selectedCall()) {
if (auto outVideo = current->firstMedia<Media::Video>(Media::Media::Direction::OUT)) {
if (auto outVideo = current->firstMedia<media::Video>(media::Media::Direction::OUT)) {
outVideo->sourceModel()->setFile(QUrl::fromLocalFile(QString::fromUtf8([theDoc.path UTF8String])));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment